#### Description
Closes https://github.com/mitmproxy/mitmproxy/issues/6547
Responses in flows constructed from HAR files were using the
`Response.make` utility which resulted in the injection of
`content-length` headers. When a `content-length` header existed
already, this could cause failures during replay.
#### Checklist
- [x] I have updated tests where applicable.
- [x] I have added an entry to the CHANGELOG.
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
#### Description
Currently when an empty cookie attribute (`Secure`, `HttpOnly` ...) is
encountered while parsing a `Set-Cookie` header it will create a
`CookieAttrs` object containing a (key, value) pair with an empty string
for the attribute value ie:
```python
CookieAttrs[('Secure', ''), ('HttpOnly', ''), ('Path', '/')]
```
Resulting in an updated `Set-Cookie` header for the `Response` object
with invalid values for those empty attributes ie:
```python
(b'SetCookie', b'value=XYZ; Secure=; HttpOnly=; Path=/')
```
My browser (Firefox 95.0.1) does not pickup these attributes so the
cookie looses them.
______
This fix replaces the empty string attribute for empty cookie attributes
by the value `None` ie:
```python
CookieAttrs[('Secure', None), ('HttpOnly', None), ('Path', '/')]
```
So that they can be told apart from attributes with intentional empty
string values when setting the updated header, which results in a
properly formatted header:
```python
(b'SetCookie', b'value=XYZ; Secure; HttpOnly; Path=/')
```
#### Checklist
- [x] I have updated tests where applicable.
- [x] I have added an entry to the CHANGELOG.
Co-authored-by: Lucas FICHEUX <lficheux@corp.free.fr>
#### Description
Designed to satisfy the requirements of
https://github.com/mitmproxy/mitmproxy/issues/3489
Add `server_replay_404_extra` which behaves similarly to the kill flag,
but returns 404 responses rather than killing
#### Checklist
- [x] I have updated tests where applicable.
- [x] I have added an entry to the CHANGELOG.
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
#### Description
* Update savehar addon to fix creating corrupt har files caused by empty
response content
#### Checklist
- [x] I have updated tests where applicable.
- [x] I have added an entry to the CHANGELOG.
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* Update http-reply-from-proxy.py
Fix#6115
* Update CHANGELOG.md
Add one line to unreleased mitmproxy next
* Update CHANGELOG.md
Correct reference to PR
---------
Co-authored-by: Maximilian Hils <git@maximilianhils.com>
* always include either SNI or target IP address as SAN
this unbreaks reverse proxy setups that are directly addressed by IP.
* [autofix.ci] apply automated fixes
* fix test
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* Added option to specify an elliptic curve for key exchange between mitmproxy <-> server
* Description of changes
* Added link to pull request to CHANGELOG
* The
et/tls.py is now only dependend on their arguments and the option tls_ecdh_curve (renamed from curve) is now accessed in tlsconfig.py.
* nits
---------
Co-authored-by: Maximilian Hils <git@maximilianhils.com>