rsnext/packages/next/shared/lib/router/utils
Sukka 87826ee186
fix(#33081): handle relative path correctly (#36823)
## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

Fixes #36823 
Closes #33084

The issue is caused by the `isLocalURL` function only checks if a URL starts with `/`, `#` or `?`. So a URL that starts with `.` will not be considered a "local URL". The PR fixes that by introducing a new util function `isAbsoluteUrl` that is fully compliant with [RFC3986](https://tools.ietf.org/html/rfc3986#section-4.3).
2022-05-22 16:43:48 +00:00
..
escape-path-delimiters.ts Move code shared between server/client to "shared" folder (#26734) 2021-06-30 11:43:31 +02:00
format-url.ts chore: replace deprecated String.prototype.substr() (#35421) 2022-03-24 17:49:38 -04:00
get-asset-path-from-route.ts Move code shared between server/client to "shared" folder (#26734) 2021-06-30 11:43:31 +02:00
get-route-from-asset-path.ts Fix dynamic routes with pages under index folder (#32440) 2021-12-13 20:36:31 +00:00
index.ts Deprecate nested Middleware in favor of root middleware (#36772) 2022-05-19 15:46:21 +00:00
is-dynamic.ts Move code shared between server/client to "shared" folder (#26734) 2021-06-30 11:43:31 +02:00
parse-next-url.ts Reduce hello-world middleware bundle size from 128k to 88k (#35512) 2022-03-22 14:54:05 +00:00
parse-relative-url.ts fix(#33081): handle relative path correctly (#36823) 2022-05-22 16:43:48 +00:00
parse-url.ts Move middleware handling to node server (#33448) 2022-01-19 12:36:06 +00:00
path-match.ts Use edge compiler for middleware (#36486) 2022-04-27 11:50:29 +02:00
prepare-destination.ts Deprecate nested Middleware in favor of root middleware (#36772) 2022-05-19 15:46:21 +00:00
querystring.ts Use fallbackable path module for node and edge runtime (#36306) 2022-04-21 09:07:03 +00:00
relativize-url.ts Fix running server with Polyfilled fetch (#32368) 2021-12-13 18:30:24 +00:00
remove-trailing-slash.ts Deprecate nested Middleware in favor of root middleware (#36772) 2022-05-19 15:46:21 +00:00
resolve-rewrites.ts Use edge compiler for middleware (#36486) 2022-04-27 11:50:29 +02:00
route-matcher.ts Deprecate nested Middleware in favor of root middleware (#36772) 2022-05-19 15:46:21 +00:00
route-regex.ts Deprecate nested Middleware in favor of root middleware (#36772) 2022-05-19 15:46:21 +00:00
sorted-routes.ts Revert "fix the dynamic routing of middleware" (#35932) 2022-04-06 14:35:52 +00:00
view-paths.ts Tweak routing tests (#36667) 2022-05-05 13:15:32 +02:00