1
0
mirror of https://github.com/kevin1024/vcrpy.git synced 2025-12-08 16:53:23 +00:00

Added test and impl for Request 'host' attribute

This commit is contained in:
Max Shytikov
2014-04-07 01:08:57 +02:00
parent 6cca703eee
commit 18ec57fa73
2 changed files with 8 additions and 0 deletions

View File

@@ -1,3 +1,6 @@
from six.moves.urllib.parse import urlparse, parse_qsl
class Request(object):
def __init__(self, method, uri, body, headers):
@@ -12,6 +15,10 @@ class Request(object):
tmp[key] = value
self.headers = frozenset(tmp.iteritems())
@property
def host(self):
return urlparse(self.uri).hostname
@property
def url(self):
return self.uri