INNER CODE UNIT · Python
get_remote_ip
bobbui/json-logging-python · json_logging/framework/connexion/__init__.py:208
def get_remote_ip(self, request):
if _is_async_request(request):
return request.client.host if request.client is not None else json_logging.EMPTY_VALUE
return request.remote_addr
def get_remote_port(self, request):
if _is_async_request(request):
return request.client.port if request.client is not None else json_logging.EMPTY_VALUE
return request.environ.get('REMOTE_PORT')
class ConnexionResponseInfoExtractor(BaseResponseInfoExtractor):
def get_status_code(self, response):
return response.status_code
def get_response_size(self, response):
if _ASGIResponse is not None and isinstance(response, _ASGIResponse):
return response.headers.get('content-length', json_logging.EMPTY_VALUE)