Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions core/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,13 @@ def _make_key(
significant_headers[h] = headers[h]

# Sort query params for consistent keys
sorted_query = {}
if query:
sorted_query = dict(sorted(query.items()))

# json.dumps(sort_keys=True) handles sorting recursively, so we don't need manual sorting here.
# We also pass dicts directly to avoid double serialization which is slow.
key_data = {
"method": method.upper(),
"url": url,
"query": json.dumps(sorted_query, sort_keys=True),
"headers": json.dumps(significant_headers, sort_keys=True),
"query": query or {},
"headers": significant_headers,
}

# For POST/PUT/PATCH with body, include body hash
Expand Down
Loading