Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
Merge pull request #383 from mozilla-services/bug/normalize_headers
Browse files Browse the repository at this point in the history
bug: force header values to lowercase underscored values
  • Loading branch information
bbangert committed Mar 4, 2016
2 parents 57243be + b4517ae commit 86e0ab1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions autopush/router/webpush.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ def _crypto_headers(self, notification):
# they're present to avoid empty strings.
for name in ["encryption-key", "crypto-key"]:
if name in headers:
# Normalize hyphens in header names.
data[name.replace("-", "_")] = headers[name]
# NOTE: The client code expects all header keys to be lower
# case and s/-/_/.
data[name.lower().replace("-", "_")] = headers[name]
return data

@inlineCallbacks
Expand Down

0 comments on commit 86e0ab1

Please sign in to comment.