Fix remove_entity_headers helper function (#1415)

* Fix `remove_entity_headers` helper function

* Add test for `remove_entity_headers` helper function
This commit is contained in:
Hasan Ramezani
2018-11-19 16:30:53 +01:00
committed by Stephen Sadowski
parent 096c44b910
commit f7adc5f84c
2 changed files with 39 additions and 1 deletions

View File

@@ -128,6 +128,6 @@ def remove_entity_headers(headers, allowed=("content-location", "expires")):
headers = {
header: value
for header, value in headers.items()
if not is_entity_header(header) and header.lower() not in allowed
if not is_entity_header(header) or header.lower() in allowed
}
return headers