Skip to content

Commit

Permalink
vweb: fix parsing url error when querypath is '//'(fix vlang#20476)
Browse files Browse the repository at this point in the history
  • Loading branch information
shove70 committed Jan 12, 2024
1 parent 0c4611f commit 0996649
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion vlib/net/urllib/urllib.v
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,8 @@ fn parse_url(rawurl string, via_request bool) !URL {
''))
}
}
if ((url.scheme != '' || !via_request) && !rest.starts_with('///')) && rest.starts_with('//') {
if ((url.scheme != '' || !via_request) && !rest.starts_with('///')) && rest.starts_with('//')
&& rest.len > 2 {
authority, r := split(rest[2..], `/`, false)
rest = r
a := parse_authority(authority)!
Expand Down

0 comments on commit 0996649

Please sign in to comment.