user3676956
user3676956

Reputation: 31

Wsgi custom field in request header

I have a probleme with apache2 and wsgi I send my server a request with a custom field in headers (HTTP_X_SOURCE) and apache2 (or wsgi) block this field. request => apache2 => web.py

Does anyone know why apache2 or wsgi block this field ?

Upvotes: 0

Views: 1429

Answers (3)

user3676956
user3676956

Reputation: 31

I find my answer here http://httpd.apache.org/docs/current/env.html#fixheader

"_" character in "HTTP_X_SOURCE" is forbidden. For security reason, Apache 2.4 is more strict than apache 2.2.

Upvotes: 2

user3676956
user3676956

Reputation: 31

I access this variable with web.ctx.env

web.ctx.env.get('HTTP_X_SOURCE')

This code works well on another server with apache 2 and wsgi.

On my new server (ubuntu 13)

test with pure web.py (no apache no wsgi), the variable pass

test with apache2-wsgi+web.py the variable don't pass

On my old server (ubuntu 12)

test with pure web.py (no apache no wsgi), the variable pass

test with apache2-wsgi+web.py the variable pass too

Upvotes: 0

Graham Dumpleton
Graham Dumpleton

Reputation: 58523

Use:

to verify if it gets to a WSGI application hosted under mod_wsgi.

It should get passed through. The issue is probably how you are trying to access it in web.py, but you don't show the code for how you are doing that.

Upvotes: 0

Related Questions