INNER CODE UNIT · Python
get_http_header
bobbui/json-logging-python · json_logging/framework/connexion/__init__.py:163
def get_http_header(self, request, header_name, default=None):
try:
if header_name in request.headers:
return request.headers.get(header_name)
except:
pass
return default
def set_correlation_id(self, request_, value):
if _is_async_request(request_):
# request.state lives in the ASGI scope, so every Request built for this scope sees it
request_.state.correlation_id = value
return
try:
_connexion.g.correlation_id = value
except:
pass