* changes for custom port number
* indent correction
* test coverage
* coverage correction
* simplify LDAP auth
* make mypy hapy
Co-authored-by: Maximilian Hils <git@maximilianhils.com>
We previously relied on the state of `Flow.reply` to check if a flow can be killed,
but this doesn't work anymore with `Flow.reply` being removed. Instead, we now
reintroduce the `Flow.live` attribute, which signals if we are on a live connection.
Killing still is not ideal (see comment in `Flow.killable`), but this paves the way.
* await server_connected hook before doing something with the connection
* refine changelog wording
Co-authored-by: Maximilian Hils <github@maximilianhils.com>
* add keyboard shortcut n to mitmweb (by creating /flows/create route)
* add keyboard shortcut n to mitmweb (simplified, by using runCommand instead of a new route)
* Add font types to asset filter (~a)
* Add PR number to changelog
* remove flash mention
* restore asset test
Co-authored-by: Maximilian Hils <github@maximilianhils.com>
* remove old pyopenssl cruft
* bump minimum version of pyopenssl
* add extra spaces to conform to style guide
* update changelog
* replace getattr with direct SSL method calls
* put version check back in but remove setdefault method calls
* tweak changelog wording
* bumb tox.ini pyOpenSSL dependency version
Co-authored-by: Karl Parkinson <karlparkinson@Karls-MBP.hitronhub.home>
* Replays via upstream also need to comply with upstream handling
* Adjusted test for HTTP upstream replay which should NOT do a CONNECT
* Added Changelog
* Test for replay https pver upstream with CONNECT
* Proxy requests use full URL with host & port
* Finally remove some prints
* lint!
Co-authored-by: Maximilian Hils <github@maximilianhils.com>
* Partial gRPC contentview prototype, not linted, no tests, not as add-on
* Linted (flake8)
* Save dev state
* Rewrote of protobuf parser, use decoding strategy, reduced rendered data. Parser uses generators
* minor cleanup
* fix: preferred encoding was provided as function instead of value
* flake8: line length
* Backlinked message tree objects, temporary debug out
* Partial implementation of gRPC definitions. Save state to fix a cras (data invalidate in edit mode)
* hack: deal with missing exception handling for generator based content views
* gRPC/Protoparser descriptions (with test code)
* replaced manual gzip decoding with mitmproxy.net.encoding.decode
* Refactored typing imports
* Reafctoring
* distinguish request vs response definitions, separate view config from parser config
* Code cleaning, moved customized protobuf definitions to example addon
* final cleanup
* changelog
* Stubs for tests
* Fixed render_riority of addon example
* Started adding tests
* Work on tests
* mypy
* Added pseudo encoder to tests, to cover special decodings
* Example addon test added
* finalized tests, no 100 percent coverage possible, see comments un uncovered code
* minor adjustments
* fixup tests
* Typos
Co-authored-by: Maximilian Hils <git@maximilianhils.com>
When updating the response content for a response, avoid adding the
'content-length' header if the response contains a 'transfer-encoding'
header, from the spec [1]:
> When a message does not have a Transfer-Encoding header field, a
Content-Length header field can provide the anticipated size, as a
decimal number of octets, for a potential payload body
Note the 'transfer-encoding' header is not used with HTTP/2
https://httpwg.org/specs/rfc7230.html#header.content-length
We accidentally reused the value for SSL3 here.
This is not as a bad as a it looks: First, neither version
is enabled by default. Second, because of how Python enums
work, this simply made the `TLS1` version unavailable
as an option (which is how I detected it).
* Make it possible to set sequence options
Attempts to fix#3015 through looking at whether or not the option is
of the type Sequence[str].
Treat all deferred options as potentially Sequence options, by making the
deferred dict values a list.
* Add full test coverage to optmanager again
* Document how to set sequence options
* minor improvements
* update changelog
Co-authored-by: Maximilian Hils <git@maximilianhils.com>
* Add `json()` method for HTTP Request and Response classes.
* Raise errors when fetching content to decode as json.
* Update http.py
Co-authored-by: Maximilian Hils <github@maximilianhils.com>
* Fix for issue #4613
* Adding tests
* Updated CHANGELOG.md
* Restoring contentviews
* Reverting contentview tests
* Adding boundary generation and tests
* Extra newline for flake8
* Janky byte fix
* Revert "Extra newline for flake8"
This reverts commit 683ba167de2264d29f318e2bab83e13cbfb8812d.
* Reverting a commit that was supposed to go to dev branch
* Update CHANGELOG.md
* Update test_http.py
Co-authored-by: Maximilian Hils <github@maximilianhils.com>
* Add `flow.comment` command and keybinding to add a comment to a flow.
* Store comment in Flow().comment. Add ~comment flowfilter syntax.
* resolve: Pythonic flow.comment
* Be consistent and use comment variable.
* keyinfo typing
* Fix parsing of certificate issuer/subject with escaped special characters
* tests
* rfc4514_attribute_name and multi value test
* pyca version + mypy happy dance
* aT lEaSt tTO sPAceS BeFOre iNLinE cOMment
* fix coverage
Co-authored-by: Maximilian Hils <github@maximilianhils.com>