Fixed query and anchor during relative redirection

This commit is contained in:
Yuriy Glukhov 2017-01-20 12:59:13 +02:00
commit 2f320fb286

View file

@ -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,