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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user