Skip to content

Commit

Permalink
Fix black and type checking issues, and update changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
JWCook committed Jan 1, 2022
1 parent 3d5f55d commit 99b7793
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions HISTORY.md
Expand Up @@ -23,6 +23,7 @@
* Some micro-optimizations for request matching

**Bugfixes:**
* Fix regression bug causing headers used for cache key to not guarantee sort order
* Handle some additional corner cases when normalizing request data
* Add support for `BaseCache` keyword arguments passed along with a backend instance
* Fix issue with cache headers not being used correctly if `cache_control=True` is used with an `expire_after` value
Expand Down
5 changes: 3 additions & 2 deletions requests_cache/cache_keys.py
Expand Up @@ -81,8 +81,9 @@ def get_matched_headers(
else:
included = set(headers) - DEFAULT_EXCLUDE_HEADERS

included = sorted(included, key=lambda x:x.lower())
return [f'{k.lower()}={headers[k]}' for k in included if k in headers]
return [
f'{k.lower()}={headers[k]}' for k in sorted(included, key=lambda x: x.lower()) if k in headers
]


def normalize_request(request: AnyRequest, ignored_parameters: ParamList) -> AnyPreparedRequest:
Expand Down

0 comments on commit 99b7793

Please sign in to comment.