|
27 | 27 | from ..consts import (
|
28 | 28 | CONTENT_SECURITY_POLICY_HEADER,
|
29 | 29 | CORRELATION_ID_HEADER,
|
30 |
| - CORS_ACCESS_CONTROL_ALLOW_CREDENTIALS_HEADER, |
31 |
| - CORS_ACCESS_CONTROL_ALLOW_METHODS_HEADER, |
32 |
| - CORS_ACCESS_CONTROL_ALLOW_ORIGIN_HEADER, |
33 |
| - HOST_HEADER, |
34 | 30 | INCOMING_REQUEST_MESSAGE,
|
35 |
| - ORIGIN_HEADER, |
36 | 31 | OUTGOING_RESPONSE_MESSAGE,
|
37 | 32 | REQUEST_COOKIE_HEADER,
|
38 | 33 | RESPONSE_COOKIE_HEADER,
|
@@ -234,27 +229,6 @@ def _wrap_all_api_responses(
|
234 | 229 | correlation_id = _get_correlation_id(request, response, log)
|
235 | 230 | response_headers = _headers_as_dict(response)
|
236 | 231 |
|
237 |
| - cors_domain: str | None = None |
238 |
| - if config.web.security.cors.origin: |
239 |
| - cors_domain = config.web.security.cors.origin |
240 |
| - else: |
241 |
| - if not response_headers.get(CORS_ACCESS_CONTROL_ALLOW_ORIGIN_HEADER): |
242 |
| - request_headers = _headers_as_dict(request) |
243 |
| - cors_domain = request_headers.get(ORIGIN_HEADER) |
244 |
| - if not cors_domain: |
245 |
| - cors_domain = request_headers.get(HOST_HEADER) |
246 |
| - |
247 |
| - if cors_domain: |
248 |
| - response_headers[CORS_ACCESS_CONTROL_ALLOW_ORIGIN_HEADER] = cors_domain |
249 |
| - |
250 |
| - response_headers[CORS_ACCESS_CONTROL_ALLOW_CREDENTIALS_HEADER] = str( |
251 |
| - config.web.security.cors.allow_credentials |
252 |
| - ) |
253 |
| - |
254 |
| - response_headers[CORS_ACCESS_CONTROL_ALLOW_METHODS_HEADER] = ",".join( |
255 |
| - config.web.security.cors.allow_methods |
256 |
| - ) |
257 |
| - |
258 | 232 | response_headers[CORRELATION_ID_HEADER] = correlation_id
|
259 | 233 |
|
260 | 234 | if config.web.security.csp:
|
|
0 commit comments