Raw request data should be exposed via request object.
|Reported by:||Damon||Owned by:||nobody|
|Severity:||Keywords:||raw request data|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I recently had the need to proxy some requests from some clients to 3rd party servers. Trying to avoid skewing stats I tried to replicate the clients headers when making the new requests to the 3rd party. Not wanting to loop through all items in request.META I looked for a Django property that exposed the raw request data. There isn't one.
I've checked the source of various Django web proxies and they either don't try to replicate headers at all or they end up with the approach I ultimately had to take - looping over request.META for "HTTP_" prefixed keys, changing them to title case and replacing underscores with hyphens.
Django needs to expose raw request data.