Fixed query and anchor during relative redirection
This commit is contained in:
parent
b2237678fb
commit
2f320fb286
1 changed files with 2 additions and 0 deletions
|
|
@ -540,6 +540,8 @@ proc getNewLocation(lastURL: string, headers: HttpHeaders): string =
|
||||||
if r.hostname == "" and r.path != "":
|
if r.hostname == "" and r.path != "":
|
||||||
var parsed = parseUri(lastURL)
|
var parsed = parseUri(lastURL)
|
||||||
parsed.path = r.path
|
parsed.path = r.path
|
||||||
|
parsed.query = r.query
|
||||||
|
parsed.anchor = r.anchor
|
||||||
result = $parsed
|
result = $parsed
|
||||||
|
|
||||||
proc get*(url: string, extraHeaders = "", maxRedirects = 5,
|
proc get*(url: string, extraHeaders = "", maxRedirects = 5,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue