client: fixed GET
This commit is contained in:
@@ -196,6 +196,11 @@ def parse_uri(uri: str):
|
||||
path = parsed.path
|
||||
if len(path) == 0 or path[0] != '/':
|
||||
path = "/" + path
|
||||
|
||||
port_pos = host.find(":")
|
||||
if port_pos >= 0:
|
||||
host = host[:port_pos]
|
||||
|
||||
return host, path
|
||||
|
||||
|
||||
@@ -213,7 +218,7 @@ def main():
|
||||
|
||||
(host, path) = parse_uri(arguments.URI)
|
||||
client = HTTPClient(host)
|
||||
client.connect((host, arguments.port))
|
||||
client.connect((host, int(arguments.port)))
|
||||
|
||||
message = "GET {path} HTTP/1.1\r\n".format(path=path)
|
||||
message += "Accept: */*\r\nAccept-Encoding: identity\r\n"
|
||||
|
Reference in New Issue
Block a user