Skip to content

Commit 09d81ea

Browse files
yangineerpi0
authored andcommitted
fix(core): support querystring only url for isRelativeURL (#492)
1 parent e21de05 commit 09d81ea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/core/utilities.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export const isSet = o => !isUnset(o)
44
export const isSameURL = (a, b) => a.split('?')[0] === b.split('?')[0]
55

66
export const isRelativeURL = u =>
7-
u && u.length && /^\/[a-zA-Z0-9@\-%_~][/a-zA-Z0-9@\-%_~]*[?]?([^#]*)#?([^#]*)$/.test(u)
7+
u && u.length && /^\/([a-zA-Z0-9@\-%_~][/a-zA-Z0-9@\-%_~]*)?([?][^#]*)?(#[^#]*)?$/.test(u)
88

99
export const parseQuery = queryString => {
1010
const query = {}

0 commit comments

Comments
 (0)