1
0
mirror of https://github.com/httpie/cli.git synced 2025-08-10 22:42:05 +02:00

Use urlsplit instead of urlparse.

Closes #118.
This commit is contained in:
Jakub Roztocil
2013-01-03 14:12:27 +01:00
parent d84d94dd55
commit 1481749c22
9 changed files with 31 additions and 13 deletions

View File

@@ -1,6 +1,6 @@
import os
import sys
from requests.compat import urlparse, is_windows, bytes, str
from .compat import urlsplit, is_windows, bytes, str
from .config import DEFAULT_CONFIG_DIR, Config
@@ -142,7 +142,7 @@ class HTTPRequest(HTTPMessage):
@property
def headers(self):
url = urlparse(self._orig.url)
url = urlsplit(self._orig.url)
# Querystring
qs = ''
@@ -166,7 +166,7 @@ class HTTPRequest(HTTPMessage):
headers = dict(self._orig.headers)
if 'Host' not in headers:
headers['Host'] = urlparse(self._orig.url).netloc
headers['Host'] = urlsplit(self._orig.url).netloc
headers = ['%s: %s' % (name, value)
for name, value in headers.items()]