mirror of
https://github.com/emikulic/darkhttpd.git
synced 2023-08-10 21:13:08 +03:00
Oops, wrong kind of line ending.
Also, enforce Connection:close since the test harness doesn't handle keep-alive.
This commit is contained in:
parent
897e85a46e
commit
77e050b4f4
|
@ -14,14 +14,16 @@ class Conn:
|
||||||
self.s.connect(("0.0.0.0", self.port))
|
self.s.connect(("0.0.0.0", self.port))
|
||||||
# connect throws socket.error on connection refused
|
# connect throws socket.error on connection refused
|
||||||
|
|
||||||
def get(self, url, http_ver="1.0", endl="\n",
|
def get(self, url, http_ver="1.0", endl="\n", req_hdrs={}):
|
||||||
req_hdrs={"User-Agent": "test.py"}):
|
|
||||||
req = "GET "+url
|
req = "GET "+url
|
||||||
if http_ver is not None:
|
if http_ver is not None:
|
||||||
req += " HTTP/"+http_ver
|
req += " HTTP/"+http_ver
|
||||||
req += "\n"
|
req += endl
|
||||||
for k,v in req_hdrs.items():
|
if http_ver is not None:
|
||||||
req += k+": "+v+endl
|
req_hdrs["User-Agent"] = "test.py"
|
||||||
|
req_hdrs["Connection"] = "close"
|
||||||
|
for k,v in req_hdrs.items():
|
||||||
|
req += k+": "+v+endl
|
||||||
req += endl # end of request
|
req += endl # end of request
|
||||||
self.s.send(req)
|
self.s.send(req)
|
||||||
ret = ""
|
ret = ""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user