diff --git a/CHANGELOG.md b/CHANGELOG.md index 956395ba2..53efdf85a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,9 @@ ## Unreleased: mitmproxy next - +* Update savehar addon to handle scenarios where "path" key in cookie + attrs dict is missing. + ([#6458](https://github.com/mitmproxy/mitmproxy/pull/6458), @pogzyb) ## 04 November 2023: mitmproxy 10.1.3 diff --git a/mitmproxy/addons/savehar.py b/mitmproxy/addons/savehar.py index dcc380c9d..59977e08e 100644 --- a/mitmproxy/addons/savehar.py +++ b/mitmproxy/addons/savehar.py @@ -281,7 +281,7 @@ class SaveHar: cookie = { "name": name, "value": value, - "path": attrs["path"], + "path": attrs.get("path", "/"), "domain": attrs.get("domain", ""), "httpOnly": "httpOnly" in attrs, "secure": "secure" in attrs,