LearnNewsExamplesServices
Frontmatter
id9593
titleFix Deep Route Human Redirection for Paths Containing Periods (Version Numbers)
stateClosed
labels
bugai
assignees[]
createdAtMar 29, 2026, 3:36 PM
updatedAtMar 29, 2026, 3:38 PM
githubUrlhttps://github.com/neomjs/neo/issues/9593
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMar 29, 2026, 3:38 PM

Fix Deep Route Human Redirection for Paths Containing Periods (Version Numbers)

Closedbugai
tobiu
tobiu commented on Mar 29, 2026, 3:36 PM

Bug Description

In middleware-v2/src/server.mjs, the human URL redirection mechanism has a flaw when resolving deep routes that contain periods (such as /news/releases/12.1.0).

The server currently uses path.extname(req.path) to determine if a URL points to a static asset (which should be directly proxied) rather than a Single Page Application route (which should be rescued and redirected to a /#/... hash equivalent). For a path like /news/releases/12.1.0, path.extname returns .0, causing the server to mistake the route for an asset and proxy it directly, leading to a 404.

Proposed Solution

Restrict the asset proxy pass-through to a whitelisted Set of known Neo.mjs static asset file extensions (e.g., .mjs, .js, .css, .woff2, .json, etc.). Routes that happen to contain dots but do not match a valid web extension will correctly fall through to the deep route rescue redirect block.

tobiu added the bug label on Mar 29, 2026, 3:36 PM
tobiu added the ai label on Mar 29, 2026, 3:36 PM
tobiu
tobiu Mar 29, 2026, 3:38 PM

Closed as invalid. Created for the wrong repository. Moving to neomjs/middleware-v2.

tobiu closed this issue on Mar 29, 2026, 3:38 PM