Skip to content

Django logging request header issue #62

Open
@leapin-devops

Description

@leapin-devops

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions