Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
- latin-1
- lequangdongg
- liuhanqu
- lkwr
- lopezac
- lordofthecactus
- loun4
Expand Down
2 changes: 2 additions & 0 deletions packages/router/__tests__/router-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10673,6 +10673,8 @@ describe("a router", () => {
"https://remix.run/blog",
"//remix.run/blog",
"app://whatever",
"mailto:[email protected]",
"web+remix:whatever",
];

for (let url of urls) {
Expand Down
3 changes: 1 addition & 2 deletions packages/router/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2683,8 +2683,7 @@ async function callLoaderOrAction(
"Redirects returned/thrown from loaders/actions must have a Location header"
);

let isAbsolute =
/^[a-z+]+:\/\//i.test(location) || location.startsWith("//");
let isAbsolute = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i.test(location);

// Support relative routing in internal redirects
if (!isAbsolute) {
Expand Down