Skip to content

Commit

Permalink
Fix router not working on some protocol
Browse files Browse the repository at this point in the history
Added support for protocols other than http and https

Fixes vercel#16456
  • Loading branch information
Cow258 committed Aug 30, 2020
1 parent ce99436 commit ea4327d
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ export function parseRelativeUrl(url: string, base?: string) {
} = new URL(url, resolvedBase)
if (
origin !== DUMMY_BASE.origin ||
(protocol !== 'http:' && protocol !== 'https:')
(protocol !== 'http:' &&
protocol !== 'https:' &&
protocol !== DUMMY_BASE.protocol)
) {
throw new Error('invariant: invalid relative URL')
}
Expand Down

0 comments on commit ea4327d

Please sign in to comment.