Aldo Cortesi
9ea68ebd28
Improve handling of pseudo-headers
...
- 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.
2016-05-31 14:36:17 +12:00
Aldo Cortesi
e8290a0eb4
Satisfy flake8
2016-05-30 12:41:44 +12:00
Thomas Kriechbaumer
e723c2d6ad
fix bytes vs. str
2016-05-29 22:17:45 +02:00
Thomas Kriechbaumer
03167d5e71
fix headers order
2016-05-29 22:07:22 +02:00
Thomas Kriechbaumer
d76e5ad1ee
raise a more verbose error
2016-05-29 19:28:59 +02:00
Thomas Kriechbaumer
e2447406cc
more style cleanup
2016-05-29 13:43:20 +02:00
Thomas Kriechbaumer
8eeab37a07
more style cleanup
...
Use this to check:
flake8 --count mitmproxy netlib pathod examples test
2016-05-29 11:55:12 +02:00
Aldo Cortesi
f3bee6f245
Merge pull request #1172 from cortesi/solidcore
...
First steps to solidifying the core
2016-05-29 20:03:40 +12:00
Maximilian Hils
85aa5da6e3
fix tests
2016-05-28 19:31:43 -07:00
Maximilian Hils
b70663f434
minor improvements
2016-05-28 19:10:49 -07:00
Aldo Cortesi
ed415877d4
Merge branch 'master' into solidcore
2016-05-29 11:14:46 +12:00
Thomas Kriechbaumer
e5038c9ab7
netlib: fix most flake8 offenses
2016-05-28 22:17:02 +02:00
Thomas Kriechbaumer
caee1adeb6
cleanup imports with flake8
2016-05-28 14:43:32 +02:00
Aldo Cortesi
735bbe52e1
Merge branch 'master' into solidcore
2016-05-28 13:09:35 +12:00
Aldo Cortesi
3a9e03ea1e
Fix crash in mitmproxy when viewing responses
2016-05-28 13:04:34 +12:00
Aldo Cortesi
7c4843857b
Sketch out a more solid core
...
- Decorator for handler methods
- Stricter checking for double-acks and non-acks
2016-05-28 11:00:00 +12:00
Maximilian Hils
d149c447fe
fix py3 tests
2016-05-25 20:31:32 -07:00
Maximilian Hils
d3477e27fa
bytes_to_escaped_str: always escape single quotes
2016-05-25 20:11:34 -07:00
Maximilian Hils
7a8da48a30
escaped_str_to_bytes: support unicode on python 2
2016-05-25 19:16:02 -07:00
Maximilian Hils
dcad3f72af
Merge branch 'issue-1099'
2016-05-20 20:02:56 -07:00
Aldo Cortesi
a5c4cd0340
A clearer implementation of MultiDictView
...
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.
2016-05-21 11:37:36 +12:00
Aldo Cortesi
96d8ec1ee3
Merge branch 'multidict' of https://github.com/mhils/mitmproxy into mhils-multidict
2016-05-21 10:15:37 +12:00
Maximilian Hils
eb914924ab
fix #1099
2016-05-20 13:59:42 -07:00
Maximilian Hils
b538138ead
tests++
2016-05-20 11:04:27 -07:00
Maximilian Hils
560fc756aa
fix Header docs
2016-05-20 09:37:13 -07:00
Maximilian Hils
6f8db2d7eb
improve MultiDict, add ImmutableMultiDict, adjust response.cookies
2016-05-18 22:50:19 -07:00
Maximilian Hils
d1fc694952
clean up odict
2016-05-18 19:01:49 -07:00
Maximilian Hils
44ac64aa72
add MultiDict
...
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.
2016-05-18 18:46:42 -07:00
Maximilian Hils
f1c922c652
Sanitize Print ( #1135 )
...
* sanitize strings with shell control characters
* netlib: add utilities to safe-print bytes
* escaped str: add TODO for multi-byte chars
2016-05-12 11:03:57 -06:00
Thomas Kriechbaumer
e2ee48a0ee
replace SimpleCookie with our own parser lib
2016-05-11 12:20:21 -05:00
Thomas Kriechbaumer
08002282e8
improve cookie parsing
...
allows '/' to be within a cookie name
removes deprecated cookie getter/setter
fixes #1118
2016-05-10 11:13:12 -05:00
Maximilian Hils
9d47d3b1ec
fix #1120
2016-05-09 12:15:20 -06:00
Maximilian Hils
54c4859a95
remove netlib version check
2016-04-29 12:00:38 -07:00
Maximilian Hils
49d1bcc8a2
fix CONNECT display in upstream mode
2016-04-20 15:27:39 -07:00
Maximilian Hils
70e35b7017
peer_address -> ip_address
2016-04-11 14:14:18 -07:00
Maximilian Hils
c22b14fae7
bump version
2016-04-09 20:01:24 -07:00
Maximilian Hils
0259f47997
Merge branch 'better-replace'
2016-04-03 08:17:30 -07:00
Thomas Kriechbaumer
f5fe93bf13
Merge pull request #1074 from mitmproxy/move-response-refresh
...
move HTTPResponse.refresh into netlib
2016-04-03 10:16:39 +02:00
Thomas Kriechbaumer
16fdbb4f2f
Merge pull request #1073 from mitmproxy/first-line-format
...
form_(in|out) -> first_line_format
2016-04-03 10:16:06 +02:00
Maximilian Hils
35a6d6e7f6
response.msg -> response.reason
2016-04-02 22:54:46 +02:00
Maximilian Hils
4e2acc4d9d
move HTTPResponse.refresh into netlib
2016-04-02 22:49:05 +02:00
Maximilian Hils
e6fa2688c9
form_(in|out) -> first_line_format
2016-04-02 21:57:35 +02:00
Maximilian Hils
4bdf7e035e
fix #1067
2016-04-02 20:20:28 +02:00
Maximilian Hils
806aa0f41c
improve .replace() and move it into netlib
2016-04-02 14:38:33 +02:00
Maximilian Hils
4ee8808b44
add Serializeable.copy
2016-04-02 13:50:53 +02:00
Thomas Kriechbaumer
ec68d8b8e4
s/nocover/no cover/g
...
according to coveralls docs
2016-03-27 12:02:41 +02:00
Matthew Shao
66bd27e6f9
update comments
2016-03-26 17:49:22 +08:00
Matthew Shao
08ff00f36d
replace CONTENT_MISSING with None.
2016-03-26 16:00:51 +08:00
Matthew Shao
2f285a6015
Setting CONTENT_MISSING to None
2016-03-26 11:26:42 +08:00
Maximilian Hils
403ac82a7d
netlib: request.path can be None
2016-03-20 23:22:50 +01:00