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 #16456
  • Loading branch information
Cow258 committed Aug 28, 2020
1 parent 20a4928 commit 0bf25e4
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 0bf25e4

Please sign in to comment.