سؤال

So lets say you have a WSGI handler:

def handle_request(environ, start_response):

The headers in environ should be something like

{'HTTP_HOST': 'localhost:8080', 'HTTP_USER_AGENT': 'Mozilla/..'}

WSGI turns "User-Agent" and "user_agent" into "HTTP_USER_AGENT", but I need the exact original name.

Are there ANY way to access the original headers / request text?

هل كانت مفيدة؟

المحلول

No there is not. As per the WSGI specification the headers are passed per CGI naming rules.

Perhaps actually describe the underlying problem you are trying to solve.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top