Bump utils and sanitise header values

Updated notifications-utils. This brings in
- the renamed character sanitization classes
- the change to allow unicode in letter addresses (this lets us delete
a test that is no longer relevant)

Also replaced non-ascii characters in headers. This fixes a bug where
non-ascii characters in a CSV filename were causing errors since the
filename is also used in the header.
This commit is contained in:
Katie Smith
2018-05-25 10:18:39 +01:00
parent 3459f74110
commit 58cc1604a7
5 changed files with 23 additions and 52 deletions

View File

@@ -33,6 +33,7 @@ from notifications_utils.recipients import (
format_phone_number_human_readable,
)
from notifications_utils.formatters import formatted_list
from notifications_utils.sanitise_text import SanitiseASCII
from werkzeug.exceptions import abort
from werkzeug.local import LocalProxy
@@ -493,6 +494,8 @@ def useful_headers_after_request(response):
del response.headers['Cache-Control']
response.headers.add(
'Cache-Control', 'no-store, no-cache, private, must-revalidate')
for key, value in response.headers:
response.headers[key] = SanitiseASCII.encode(value)
return response