Skip to content

Commit

Permalink
Remove remove_entity_headers()
Browse files Browse the repository at this point in the history
  • Loading branch information
Tronic committed Nov 15, 2023
1 parent 8027563 commit 30c9968
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions sanic/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,25 +122,6 @@ def is_hop_by_hop_header(header):
return header.lower() in _HOP_BY_HOP_HEADERS


def remove_entity_headers(headers, allowed=("content-location", "expires")):
"""
Removes all the entity headers present in the headers given.
According to RFC 2616 Section 10.3.5,
Content-Location and Expires are allowed as for the
"strong cache validator".
https://tools.ietf.org/html/rfc2616#section-10.3.5
returns the headers without the entity headers
"""
allowed = set([h.lower() for h in allowed])
headers = {
header: value
for header, value in headers.items()
if not is_entity_header(header) or header.lower() in allowed
}
return headers


def import_string(module_name, package=None):
"""
import a module or class by string path.
Expand Down

0 comments on commit 30c9968

Please sign in to comment.