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))
|
||||
# connect throws socket.error on connection refused
|
||||
|
||||
def get(self, url, http_ver="1.0", endl="\n",
|
||||
req_hdrs={"User-Agent": "test.py"}):
|
||||
def get(self, url, http_ver="1.0", endl="\n", req_hdrs={}):
|
||||
req = "GET "+url
|
||||
if http_ver is not None:
|
||||
req += " HTTP/"+http_ver
|
||||
req += "\n"
|
||||
for k,v in req_hdrs.items():
|
||||
req += k+": "+v+endl
|
||||
req += endl
|
||||
if http_ver is not None:
|
||||
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
|
||||
self.s.send(req)
|
||||
ret = ""
|
||||
|
Loading…
Reference in New Issue
Block a user