diff options
author | Maximilian Hils <git@maximilianhils.com> | 2015-07-24 17:43:41 +0200 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2015-07-24 17:43:41 +0200 |
commit | f8b4d666870163d6770aabefe212b8ecd981d490 (patch) | |
tree | 8c6f2fc9ef4c06c40a04514f651785540d278bf3 /libpathod/language/http.py | |
parent | 9a1bee31d6d7b92bf5b4cb68d853c856acdfb036 (diff) | |
parent | 96c9c4459f0bb9b76ab34f8c8d03d0e5d28621f4 (diff) | |
download | mitmproxy-f8b4d666870163d6770aabefe212b8ecd981d490.tar.gz mitmproxy-f8b4d666870163d6770aabefe212b8ecd981d490.tar.bz2 mitmproxy-f8b4d666870163d6770aabefe212b8ecd981d490.zip |
Merge pull request #31 from Kriechi/protocol-refactor
HTTP protocol refactoring
Diffstat (limited to 'libpathod/language/http.py')
-rw-r--r-- | libpathod/language/http.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libpathod/language/http.py b/libpathod/language/http.py index 3c9df484..380a5d64 100644 --- a/libpathod/language/http.py +++ b/libpathod/language/http.py @@ -4,7 +4,7 @@ import abc import pyparsing as pp import netlib.websockets -from netlib import http_status, http_uastrings +from netlib.http import status_codes, user_agents from . import base, exceptions, actions, message @@ -78,13 +78,13 @@ class ShortcutLocation(_HeaderMixin, base.Value): class ShortcutUserAgent(_HeaderMixin, base.OptionsOrValue): preamble = "u" - options = [i[1] for i in http_uastrings.UASTRINGS] + options = [i[1] for i in user_agents.UASTRINGS] key = base.TokValueLiteral("User-Agent") def values(self, settings): value = self.value.val if self.option_used: - value = http_uastrings.get_by_shortcut(value.lower())[2] + value = user_agents.get_by_shortcut(value.lower())[2] return self.format_header( self.key.get_generator(settings), @@ -175,7 +175,7 @@ class Response(_HTTPMessage): l.extend(self.reason.values(settings)) else: l.append( - http_status.RESPONSES.get( + status_codes.RESPONSES.get( code, "Unknown code" ) @@ -194,7 +194,7 @@ class Response(_HTTPMessage): 1, Code(101) ) - hdrs = netlib.websockets.server_handshake_headers( + hdrs = netlib.websockets.WebsocketsProtocol.server_handshake_headers( settings.websocket_key ) for i in hdrs.lst: @@ -306,7 +306,7 @@ class Request(_HTTPMessage): 1, Method("get") ) - for i in netlib.websockets.client_handshake_headers().lst: + for i in netlib.websockets.WebsocketsProtocol.client_handshake_headers().lst: if not get_header(i[0], self.headers): tokens.append( Header( |