dabapps / django-log-request-id

Django middleware and log filter to attach a unique ID to every log message generated as part of a request
BSD 2-Clause "Simplified" License
371 stars 64 forks source link

Support customisation of the outgoing request ID header in the Session #16

Closed j4mie closed 8 years ago

j4mie commented 8 years ago

This allows you to control the outgoing header set by the requests.Session subclass independently of the incoming header.

This is important mostly because Django prepends HTTP_ to its headers in request.META. So if your LOG_REQUEST_ID_HEADER was set to, say, HTTP_X_REQUEST_ID, and you were passing that on to a downstream Django app, it would end up as HTTP_HTTP_X_REQUEST_ID.

This PR maintains the previous behaviour by default so doesn't break backwards compatibility.

weargoggles commented 8 years ago

Looks good 🐯