Add check to preserve Next.js static assets in path normalization
This commit is contained in:
parent
55ec443309
commit
6433d2f66c
1 changed files with 6 additions and 0 deletions
|
|
@ -7,6 +7,12 @@ function normalizePathSeparators(value: string): string {
|
|||
function toServedPath(rawPath: string): string {
|
||||
const normalized = normalizePathSeparators(decodeURIComponent(rawPath));
|
||||
|
||||
// Never rewrite Next.js bundled/static assets.
|
||||
// Example: /_next/static/media/*.svg should stay unchanged.
|
||||
if (normalized.startsWith("/_next/static/")) {
|
||||
return normalized;
|
||||
}
|
||||
|
||||
// Prefer canonical FastAPI-mounted roots when present.
|
||||
const appDataIdx = normalized.indexOf("/app_data/");
|
||||
if (appDataIdx !== -1) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue