Skip to content

Commit

Permalink
Merge pull request #1112 from mozilla-services/disable-safe-headers
Browse files Browse the repository at this point in the history
Disable safe headers by default in backport lambda
  • Loading branch information
leplatrem authored Sep 15, 2020
2 parents 020740c + c308c7b commit 3752b8c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Environment config:
- ``BACKPORT_RECORDS_DEST_COLLECTION``:collection id to copy records to (default: same as source collection)
- ``REQUESTS_TIMEOUT_SECONDS``: Connection/Read timeout in seconds (default: ``2``)
- ``REQUESTS_NB_RETRIES``: Number of retries before failing (default: ``4``)
- ``SAFE_HEADERS``: Add concurrency control headers to update requests (default: ``true``)
- ``SAFE_HEADERS``: Add concurrency control headers to update requests (default: ``false``)

Example:

Expand Down
2 changes: 1 addition & 1 deletion commands/backport_records.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def backport_records(event, context, **kwargs):
os.getenv("BACKPORT_RECORDS_DEST_COLLECTION", source_collection),
)
safe_headers = event.get(
"safe_headers", config("SAFE_HEADERS", default=True, cast=bool)
"safe_headers", config("SAFE_HEADERS", default=False, cast=bool)
)

if source_bucket == dest_bucket and source_collection == dest_collection:
Expand Down
1 change: 1 addition & 0 deletions tests/test_backport_records.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ def test_outdated_records_are_overwritten(self):
backport_records(
event={
"server": self.server,
"safe_headers": True,
"backport_records_source_auth": self.auth,
"backport_records_source_bucket": self.source_bid,
"backport_records_source_collection": self.source_cid,
Expand Down

0 comments on commit 3752b8c

Please sign in to comment.