cf-python-logging-support icon indicating copy to clipboard operation
cf-python-logging-support copied to clipboard

Django logging request header issue

Open leapin-devops opened this issue 4 years ago • 1 comments

It seems we can't get expected "correlation_id" via DjangoRequestReader class.

def get_http_header(self, request, header_name, default=None):
  if request is None:
      return default
  
  if header_name in request.META:
      return request.META.get(header_name)
  if header_name.upper() in request.META:
      return request.META.get(header_name.upper())
  
  return default

Since in Django, header name will be prefixed with "HTTP_" and replace "-" to "_" in request.META.

Is there any special consideration here?

I am glad to create a PR if it needs fix here.

leapin-devops avatar Jan 11 '22 06:01 leapin-devops

Hello,

Sorry for the late response. A Pull Request with this fix will be appreciated and we will review it.

BR, Viktor

Viktor-Velkov avatar Nov 01 '23 08:11 Viktor-Velkov