diff --git a/mindinsight/backend/application.py b/mindinsight/backend/application.py index b9f63b0c..73b941f1 100644 --- a/mindinsight/backend/application.py +++ b/mindinsight/backend/application.py @@ -71,13 +71,14 @@ class CustomResponse(Response): """Define custom response.""" def __init__(self, response=None, **kwargs): headers = kwargs.get("headers") + security_headers = list(SECURITY_HEADERS) if isinstance(response, bytes): mimetype = get_img_mimetype(response) - SECURITY_HEADERS.append(('Content-Type', mimetype)) + security_headers.append(('Content-Type', mimetype)) if headers is None: - headers = Headers(SECURITY_HEADERS) + headers = Headers(security_headers) else: - for header in SECURITY_HEADERS: + for header in security_headers: headers.add(*header) kwargs['headers'] = headers super(CustomResponse, self).__init__(response, **kwargs)