Whole file
cyberjunky/python-garminconnect
The author described this change as “fix: sanitize Set-Cookie cassette headers case-insensitively”. It counts as a record because the check below fails on the code as it stood at 2fd4a9a72 and passes on 0aa8dc1a4, with nothing else changed between the two runs.
Fix saved2026-07-26
Sharing licenceMIT · LICENSE
Change size+3 −4
What the code was meant to do, written into the code itself as a save note
fix: sanitize Set-Cookie cassette headers case-insensitively
The change
| 153 | 153 | if k.lower() not in headers_to_remove | |
| 154 | 154 | } | |
| 155 | 155 | ||
| 156 | - | for key in ["set-cookie", "Set-Cookie"]: | |
| 157 | - | if key in response["headers"]: | |
| 156 | + | for key in response["headers"]: | |
| 157 | + | if key.casefold() == "set-cookie": | |
| 158 | 158 | cookies = response["headers"][key] | |
| 159 | - | sanitized_cookies = [sanitize_cookie(cookie) for cookie in cookies] | |
| 160 | - | response["headers"][key] = sanitized_cookies | |
| 159 | + | response["headers"][key] = [sanitize_cookie(cookie) for cookie in cookies] | |
| 161 | 160 | ||
| 162 | 161 | body = response["body"]["string"] | |
| 163 | 162 | if isinstance(body, bytes): |
The check that tells the two apart
fail→pass·tests/test_cassette_sanitization.py::test_sanitize_response_scrubs_set_cookie_case_insensitively
Check file tests/test_cassette_sanitization.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before it2fd4a9a724d48162046fad1718868ceab64a95ff
Broken version dated2026-07-26
Moduletests.conftest
Units changedsanitize_response
Fingerprint9dc1dbc856a5f5c3
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.