aboutsummaryrefslogtreecommitdiffstats
path: root/netlib/utils.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix netlib.utils.is_valid_hostAldo Cortesi2016-07-211-2/+2
| | | | | | | | - 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.
* Convert examples and example tests for new-style scriptsAldo Cortesi2016-07-141-0/+7
| | | | | Remove the test that just loads all the example scripts for now - it's a very low-value test, and we need to think of something better.
* sni is now str, not bytesMaximilian Hils2016-07-061-3/+1
|
* Utils cleanupsAldo Cortesi2016-06-071-15/+0
| | | | | | | | - 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.
* Shift a bunch more string-related functions to strutilsAldo Cortesi2016-06-021-15/+0
|
* Utils reorganisation: add netlib.strutilsAldo Cortesi2016-06-021-100/+2
| | | | Extract a number of string and format-related functions to netlib.strutils.
* Satisfy flake8Aldo Cortesi2016-05-311-0/+1
|
* Move human-friendly format functions to netlib.human, remove redundant ↵Aldo Cortesi2016-05-311-16/+0
| | | | implementations
* utils.multipartdecode -> http.multipart.decodeAldo Cortesi2016-05-311-56/+0
| | | | | | also utils.parse_content_type -> http.headers.parse_content_type
* netlib.utils.get_header_tokens -> netlib.http1.read.get_header_tokensAldo Cortesi2016-05-311-12/+0
| | | | Placing this next to its only use.
* isascii is unusedAldo Cortesi2016-05-311-8/+0
|
* Extract url functions from netlib.utils and move to netlib.http.urlAldo Cortesi2016-05-311-95/+0
|
* Start cleaning up netlib.utilsAldo Cortesi2016-05-311-52/+0
| | | | | - Remove http2 functions, move to http2.frame - Remove Serializable, move to netlib.basetypes
* raise a more verbose errorThomas Kriechbaumer2016-05-291-3/+3
|
* fix py3 testsMaximilian Hils2016-05-251-1/+1
|
* bytes_to_escaped_str: always escape single quotesMaximilian Hils2016-05-251-1/+7
|
* escaped_str_to_bytes: support unicode on python 2Maximilian Hils2016-05-251-1/+5
|
* add MultiDictMaximilian Hils2016-05-181-11/+0
| | | | | | | | 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.
* Sanitize Print (#1135)Maximilian Hils2016-05-121-0/+28
| | | | | | | | * sanitize strings with shell control characters * netlib: add utilities to safe-print bytes * escaped str: add TODO for multi-byte chars
* fix #1120Maximilian Hils2016-05-091-0/+2
|
* improve .replace() and move it into netlibMaximilian Hils2016-04-021-0/+10
|
* add Serializeable.copyMaximilian Hils2016-04-021-0/+3
|
* combine projectsMaximilian Hils2016-02-181-0/+418