Commit Graph

108 Commits

Author SHA1 Message Date
Maximilian Hils
f27028f58e introduce Response.make for simple response creation 2016-08-23 00:17:06 -07:00
Shadab Zafar
bc175b58f2 Use test times less than 2038
So that tests pass on 32bit systems too
2016-08-15 12:00:23 +05:30
Shadab Zafar
ec0bae35c5 Assert cookie groups explicitly rather than just the length 2016-08-15 12:00:23 +05:30
Shadab Zafar
988174246b Add some cookie formatting related tests 2016-08-15 12:00:23 +05:30
Shadab Zafar
03e6117042 Add a function to get cookie expiration time 2016-08-15 12:00:23 +05:30
Shadab Zafar
a479c51465 Add method to group pairs by cookies 2016-08-15 12:00:23 +05:30
Aldo Cortesi
ca0eab0f05 Merge pull request #1447 from mitmproxy/secure-by-default
Verify upstream certificates by default
2016-08-01 14:44:16 +12:00
Maximilian Hils
ca2e338876 Merge pull request #1449 from mhils/fix-1448
Add escape_single_quotes=False arg to bytes_to_escaped_str
2016-07-30 15:56:55 -07:00
Angelo Agatino Nicolosi
6792ec4058 Integrated encode/decoder for brotli 2016-07-30 14:43:53 +02:00
Maximilian Hils
4534363671 add escape_single_quotes=False arg to bytes_to_escaped_str 2016-07-29 19:54:44 -07:00
Maximilian Hils
8b325fd65a improve invalid certificate ux 2016-07-27 21:01:28 -07:00
Maximilian Hils
013288f7ca add quote/unquote tests 2016-07-24 19:38:44 -07:00
Maximilian Hils
e07f515a20 remove content caching in netlib.http.Message 2016-07-23 19:05:10 -07:00
Maximilian Hils
d6209fa03b add tests for single-element cache 2016-07-23 19:04:57 -07:00
Maximilian Hils
798759d2b3 fix content view cache invalidation 2016-07-21 19:49:32 -07:00
Aldo Cortesi
33ffbc28ed console: share one ActionBar instance
This fixes an issues where popping a view off the stack caused stale ActionBar
contents to be displayed.
2016-07-21 15:41:43 +12:00
Aldo Cortesi
02acfb1242 Fix netlib.utils.is_valid_host
- Don't crash when passed an empty string. This translated into an actual core
crash, discovered while fuzzing with afl.
- Taking a slice of length one out of bytes returns an integer, so the check
for trailing period in this function never worked on Python3.
- Add unit tests.
2016-07-21 10:38:37 +12:00
Thomas Kriechbaumer
a32312cecc fix-1366 2016-07-16 18:31:37 +02:00
Maximilian Hils
e6e39ce80f preserve content-type parameter order 2016-07-15 23:46:12 -07:00
Maximilian Hils
3602fd7a36 Merge remote-tracking branch 'origin/master' into message-body-encoding 2016-07-15 23:17:57 -07:00
Maximilian Hils
a3c7c84d49 improve message content semantics 2016-07-15 22:50:33 -07:00
Shadab Zafar
39f5108400 Test cookies.is_expired separately 2016-07-10 01:06:50 +05:30
Shadab Zafar
83a1cc5a9a Make escape_control_characters handle strings on Py2 2016-07-09 13:28:20 +05:30
Maximilian Hils
00dce24015 tests++ 2016-07-07 18:02:59 -07:00
Maximilian Hils
76473d44e0 py3++ 2016-07-07 17:50:26 -07:00
Maximilian Hils
f62e976e1e py3++ 2016-07-07 17:29:22 -07:00
Maximilian Hils
64a867973d sni is now str, not bytes 2016-07-06 21:03:17 -07:00
Maximilian Hils
444f0a4c39 py3++ 2016-07-06 17:31:08 -07:00
Maximilian Hils
d51cf543bb remove clean_bin, clarify unicode handling 2016-07-05 15:11:32 -07:00
Thomas Kriechbaumer
8d2042ea8a http2: test throttling at MAX_CONCURRENT_STREAMS 2016-07-05 22:15:57 +02:00
Maximilian Hils
a6b3551934 raise ValueError if content-encoding is invalid 2016-07-04 13:58:09 -07:00
Maximilian Hils
2f8a1fd2cb tests++ 2016-07-02 03:03:42 -07:00
Maximilian Hils
6032c4f235 message.content -> .raw_content, implement .text
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.
2016-07-02 01:51:47 -07:00
Maximilian Hils
2c09e0416b minor fixes 2016-07-01 17:49:18 -07:00
Maximilian Hils
536c7acd13 py3++ 2016-07-01 14:10:48 -07:00
Thomas Kriechbaumer
eb3ed87100 move custom HTTP/2 stack from netlib to pathod 2016-06-17 15:06:01 +02:00
Aldo Cortesi
a63817f2b8 Merge pull request #1253 from mhils/fix-debug
Fix Debug Mode on Windows
2016-06-14 17:12:02 +12:00
Aldo Cortesi
4c292b0197 Fix Python3 tests 2016-06-14 16:13:50 +12:00
Aldo Cortesi
50a20fefee Satisfy lint 2016-06-14 14:34:30 +12:00
Aldo Cortesi
9e63350a96 Use handlers in http2 test suite 2016-06-14 14:32:18 +12:00
Aldo Cortesi
e6fd98bb72 Start rolling out leak detection in netlib 2016-06-14 14:32:18 +12:00
Maximilian Hils
3c9a70b761 fix debug mode on Windows 2016-06-13 18:06:44 -07:00
Aldo Cortesi
7b86560ded debug: On SIGUSR2, we dump tracebacks for all threads to screen 2016-06-11 23:07:42 +12:00
Aldo Cortesi
09edbd9492 Improve debugging of thread and other leaks
- Add basethread.BaseThread that all threads outside of test suites should use
- Add a signal handler to mitmproxy, mitmdump and mitmweb that dumps resource
information to screen when SIGUSR1 is received.
- Improve thread naming throughout to make thread dumps understandable
2016-06-11 19:52:24 +12:00
Aldo Cortesi
5b9f07c81c debug.sysinfo: tests and coverage 2016-06-11 17:56:17 +12:00
Aldo Cortesi
c421c41307 Remove odict
- 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
2016-06-09 13:28:43 +12:00
Maximilian Hils
c98c83190b tests++ 2016-06-07 01:03:08 -07:00
Aldo Cortesi
1ffc273c94 Utils cleanups
- 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.
2016-06-07 17:12:52 +12:00
redfast00
25505733bc
fix multidict unittests 2016-06-05 21:20:37 +02:00
Aldo Cortesi
09da1febbd Shift a bunch more string-related functions to strutils 2016-06-02 13:04:19 +12:00