Django logging request header issue

Open
#62 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
django, python

Research direction

Start at the DjangoRequestReader class and its get_http_header method, then compare the requested correlation_id lookup with Django's request.META header format described in the issue. Done means the expected correlation_id can be retrieved through this reader, with the behavior verified against the reported request-header shape.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Python
Stars
18
Forks
11
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from SAP/cf-python-logging-support

All issues in SAP/cf-python-logging-support

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.