add host test
This commit is contained in:
parent
f0e818a28c
commit
e792a1e030
|
@ -88,7 +88,7 @@ The following variables are accessible as properties on `Request` objects:
|
|||
- `url`: The full URL of the request, ie: `http://localhost:8000/posts/1/?foo=bar`
|
||||
- `scheme`: The URL scheme associated with the request: `http` or `https`
|
||||
- `host`: The host associated with the request: `localhost:8080`
|
||||
- `path`: The path of the request: `/posts/1`/
|
||||
- `path`: The path of the request: `/posts/1/`
|
||||
- `query_string`: The query string of the request: `foo=bar` or a blank string `''`
|
||||
|
||||
|
||||
|
|
|
@ -149,7 +149,7 @@ class Request(dict):
|
|||
def host(self):
|
||||
# it appears that httptools doesn't return the host
|
||||
# so pull it from the headers
|
||||
return self.headers['Host']
|
||||
return self.headers.get('Host', '')
|
||||
|
||||
@property
|
||||
def path(self):
|
||||
|
|
Loading…
Reference in New Issue
Block a user