aboutsummaryrefslogtreecommitdiffstats
path: root/netlib/http
Commit message (Collapse)AuthorAgeFilesLines
...
| * | message.content -> .raw_content, implement .textMaximilian Hils2016-07-024-66/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This PR improves our handling of HTTP message body encodings: - The unaltered message body is now accessible as `.raw_content` - The "content-encoding"-decoded content (i.e. gzip removed) content is not `.content`, as this is what we want in 99% of the cases. - `.text` now provides the "content-encoding"-decoded and then "content-type charset"-decoded message body. - The decoded values for `.content` and `.text` are cached, so that repeated access and `x.text = x.text` is cheap. - The `decoded()` decorator is now deprecated, as we can now just use `.content`. Similarly `HTTPMessage.get_decoded_content()` is deprecated.
* | | replacehooks -> addonAldo Cortesi2016-07-161-2/+2
| |/ |/| | | | | | | Also fixes a bug in header replacements in netlib that resulted in a mutable multidict.
* | Test cookies.is_expired separatelyShadab Zafar2016-07-101-4/+9
| |
* | Move cookie expiry detection to separate functionShadab Zafar2016-07-091-1/+23
| |
* | py3++Maximilian Hils2016-07-073-1/+23
| |
* | py3++, multidict fixesMaximilian Hils2016-07-062-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | This commit improves Python 3 compatibility and fixes two multidict issues: 1. Headers.items(multi=True) now decodes fields 2. MultiDict.clear(item) has been removed, as Python's MutableMapping already defines .clear() with different semantics. This is confusing for everyone who expects a dict-like object. `.pop("attr", None)` is not fantastic, but it's the Python way to do it.
* | py3: fix bytes vs. strThomas Kriechbaumer2016-07-031-4/+4
| |
* | h2: move header parsing to netlibShadab Zafar2016-07-032-0/+39
|/
* fix tcp message handlingMaximilian Hils2016-07-011-1/+3
|
* py3++Maximilian Hils2016-07-013-7/+17
|
* Handle case when scheme is NoneShadab Zafar2016-07-011-1/+1
|
* http2: improve error handling in testsThomas Kriechbaumer2016-06-221-1/+2
|
* move custom HTTP/2 stack from netlib to pathodThomas Kriechbaumer2016-06-172-434/+0
|
* Py3: fix http2 bytes issueShadab Zafar2016-06-151-2/+2
|
* Remove odictAldo Cortesi2016-06-091-4/+5
| | | | | | | | - Adds default implementations for _kconv and _reduce_values to MultiDict. Without these, operations fail in really, really non-obvious ways. - Replace the remaining few instances of ODict Fixes #1159
* Utils cleanupsAldo Cortesi2016-06-072-3/+16
| | | | | | | | - Move more stuff that belongs in netlib.human - Move some stuff to near the only use - Zap mitmproxy.utils.timestamp(). I see the rationale, but we used it interchangeably with time.time() throughout the project. Since time.time() dominates in the codebase and timestamp() is such low utility, away it goes.
* minor fixesMaximilian Hils2016-06-062-5/+5
|
* Fix test that may fail due to binary header dataAldo Cortesi2016-06-051-1/+3
| | | | | | | | This is just inherently not a determinisitc test. We don't use the log HTTP interface any more, so it can just go. A more radical "solution" is inbound shortly. Fixes #1207
* Utils reorganisation: add netlib.strutilsAldo Cortesi2016-06-023-7/+7
| | | | Extract a number of string and format-related functions to netlib.strutils.
* Merge pull request #1183 from mitmproxy/module-importsAldo Cortesi2016-06-011-1/+3
|\ | | | | use module-level imports only
| * use module-level imports onlyMaximilian Hils2016-05-311-1/+3
| |
* | Reorganise netlib imports according to Google Style GuideAldo Cortesi2016-06-0112-112/+117
|/
* be more strict about module namespacesMaximilian Hils2016-05-311-4/+4
|
* Fix tests harderAldo Cortesi2016-05-311-2/+2
|
* http2.frame -> http2.framereaderAldo Cortesi2016-05-311-0/+0
|
* Satisfy flake8Aldo Cortesi2016-05-312-1/+2
|
* Move human-friendly format functions to netlib.human, remove redundant ↵Aldo Cortesi2016-05-311-2/+2
| | | | implementations
* utils.multipartdecode -> http.multipart.decodeAldo Cortesi2016-05-313-1/+61
| | | | | | also utils.parse_content_type -> http.headers.parse_content_type
* netlib.utils.get_header_tokens -> netlib.http1.read.get_header_tokensAldo Cortesi2016-05-311-1/+13
| | | | Placing this next to its only use.
* Module is part of the name - url.decode, not url.urldecodeAldo Cortesi2016-05-314-15/+15
| | | | A pattern we need to use far more often in the codebase
* Extract url functions from netlib.utils and move to netlib.http.urlAldo Cortesi2016-05-314-12/+109
|
* Start cleaning up netlib.utilsAldo Cortesi2016-05-314-39/+60
| | | | | - Remove http2 functions, move to http2.frame - Remove Serializable, move to netlib.basetypes
* Improve handling of pseudo-headersAldo Cortesi2016-05-311-6/+8
| | | | | | | | | - The canonical source for :method, :scheme and :path are the .method, .scheme and .path attributes on the request object. - These pseudo-headers are stripped after reading the request, and re-inserted just before sending. - The :authority header remains, and should be handled analagously to the Host header in HTTP1 with respect to display and user interaction.
* Satisfy flake8Aldo Cortesi2016-05-301-5/+0
|
* more style cleanupThomas Kriechbaumer2016-05-292-3/+3
|
* more style cleanupThomas Kriechbaumer2016-05-291-2/+2
| | | | Use this to check: flake8 --count mitmproxy netlib pathod examples test
* fix testsMaximilian Hils2016-05-283-3/+3
|
* netlib: fix most flake8 offensesThomas Kriechbaumer2016-05-284-9/+24
|
* cleanup imports with flake8Thomas Kriechbaumer2016-05-284-5/+0
|
* Merge branch 'issue-1099'Maximilian Hils2016-05-201-0/+6
|\
| * fix #1099Maximilian Hils2016-05-201-0/+6
| |
* | A clearer implementation of MultiDictViewAldo Cortesi2016-05-214-97/+55
|/ | | | | | This makes MultiDictView work with a simple getter/setter pair, rather than using attributes with implicit leading underscores. Also move MultiDictView into multidict.py and adds some simple unit tests.
* tests++Maximilian Hils2016-05-202-3/+3
|
* fix Header docsMaximilian Hils2016-05-201-3/+3
|
* improve MultiDict, add ImmutableMultiDict, adjust response.cookiesMaximilian Hils2016-05-186-87/+123
|
* add MultiDictMaximilian Hils2016-05-187-136/+137
| | | | | | | | This commit introduces MultiDict, a multi-dictionary similar to ODict, but with improved semantics (as in the Headers class). MultiDict fixes a few issues that were present in the Request/Response API. In particular, `request.cookies["foo"] = "bar"` has previously been a no-op, as the cookies property returned a mutable _copy_ of the cookies.
* replace SimpleCookie with our own parser libThomas Kriechbaumer2016-05-111-1/+1
|
* improve cookie parsingThomas Kriechbaumer2016-05-103-37/+20
| | | | | allows '/' to be within a cookie name removes deprecated cookie getter/setter fixes #1118
* fix #1120Maximilian Hils2016-05-091-1/+1
|
* fix CONNECT display in upstream modeMaximilian Hils2016-04-201-0/+2
|