est
est

Reputation: 11855

is it impossible to restore http request header orders in wsgi python?

from what I understand, wsgi turns http headers into envion variables with HTTP_ prefix and capitalized header names.

Request goes like this:

GET /h HTTP/1.1
X2: a
X1: b

on server this is what we've got in environ so far

"HTTP_X1":  b,
"HTTP_X2":  a

So it's theoretically impossible to tell which header comes first and which goes to the last?

Are there any hacks under WSGI that allows to restoring HTTP request headers to its raw text?

Upvotes: 2

Views: 138

Answers (1)

tom
tom

Reputation: 19153

In a WSGI application, you unfortunately lose the ordering information of the request headers.

Upvotes: 2

Related Questions