api should not break if it sends a 304
This commit is contained in:
parent
4771f8828e
commit
b5337af65e
1 changed files with 3 additions and 2 deletions
|
@ -6,7 +6,8 @@ class RemoveEtagFromHTMLApiViewMiddleware:
|
|||
response = self.get_response(request)
|
||||
|
||||
if request.path.startswith('/api/'):
|
||||
if response['content-type'].startswith('text/html') and response.has_header('etag'):
|
||||
del response['etag']
|
||||
if response.has_header('content-type') and response['content-type'].startswith('text/html'):
|
||||
if response.has_header('etag'):
|
||||
del response['etag']
|
||||
|
||||
return response
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue