bugfix: httpclient

This commit is contained in:
Araq 2010-10-30 19:13:35 +02:00
commit d11a62af31
2 changed files with 9 additions and 2 deletions

View file

@ -238,8 +238,10 @@ proc request*(url: string, httpMethod = httpGET, extraHeaders = "",
var headers = copy($httpMethod, len("http"))
if r.path != "":
headers.add(" " & r.path & r.query)
headers.add(" / HTTP/1.1\c\L")
headers.add(" /" & r.path & r.query)
else:
headers.add(" /")
headers.add(" HTTP/1.1\c\L")
add(headers, "Host: " & r.hostname & "\c\L")
add(headers, extraHeaders)