Commit 255c1d11 authored by rboyer-anybox's avatar rboyer-anybox Committed by Diederik van der Boor
Browse files

fix: fallabck value for HTTP_USER_AGENT should be a string

if `request.META["HTTP_USER_AGENT"]` is not set the fallback value should an empty string instead of None
or else we get a `TypeError: argument of type 'NoneType' is not iterable` on `if 'WebKit' in user_agent:`
parent 3fb30149
...@@ -126,7 +126,7 @@ class PrivateStorageView(View): ...@@ -126,7 +126,7 @@ class PrivateStorageView(View):
The filename, encoded to use in a ``Content-Disposition`` header. The filename, encoded to use in a ``Content-Disposition`` header.
""" """
# Based on https://www.djangosnippets.org/snippets/1710/ # Based on https://www.djangosnippets.org/snippets/1710/
user_agent = self.request.META.get('HTTP_USER_AGENT', None) user_agent = self.request.META.get('HTTP_USER_AGENT', '')
if 'WebKit' in user_agent: if 'WebKit' in user_agent:
# Support available for UTF-8 encoded strings. # Support available for UTF-8 encoded strings.
# This also matches Edgee. # This also matches Edgee.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment