From 5226ac200fb13f1c19a2d91344ae516d32e756e6 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Sun, 7 Sep 2014 03:18:18 +0200 Subject: update code docs, make sure that url attribute never returns prettified/formatted values --- libmproxy/protocol/http.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'libmproxy/protocol') diff --git a/libmproxy/protocol/http.py b/libmproxy/protocol/http.py index c67cb471..5d06f1f2 100644 --- a/libmproxy/protocol/http.py +++ b/libmproxy/protocol/http.py @@ -193,11 +193,14 @@ class HTTPRequest(HTTPMessage): method: HTTP method - scheme: URL scheme (http/https) (absolute-form only) + scheme: URL scheme (http/https) - host: Host portion of the URL (absolute-form and authority-form only) + host: Target hostname of the request. This is not neccessarily the directy upstream server (which could be + another proxy), but it's always the target server we want to reach at the end. This attribute is either + inferred from the request itself (absolute-form, authority-form) or from the connection metadata (e.g. the + host in reverse proxy mode). - port: Destination port (absolute-form and authority-form only) + port: Destination port path: Path portion of the URL (not present in authority-form) @@ -501,7 +504,10 @@ class HTTPRequest(HTTPMessage): """ Returns a URL string, constructed from the Request's URL components. """ - return self.pretty_url(False) + return utils.unparse_url(self.scheme, + self.host, + self.port, + self.path).encode('ascii') @url.setter def url(self, url): -- cgit v1.2.3