Update savehar.py

Use `.get` when retrieving "path" from the `attrs` cookie dict. This avoids the occasional `KeyError`.
This commit is contained in:
pogzyb 2023-11-04 11:07:01 -04:00 committed by GitHub
parent d6986d43cd
commit ad4ac04d2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -281,7 +281,7 @@ class SaveHar:
cookie = { cookie = {
"name": name, "name": name,
"value": value, "value": value,
"path": attrs["path"], "path": attrs.get("path", "/"),
"domain": attrs.get("domain", ""), "domain": attrs.get("domain", ""),
"httpOnly": "httpOnly" in attrs, "httpOnly": "httpOnly" in attrs,
"secure": "secure" in attrs, "secure": "secure" in attrs,