Roundup Tracker - Issues

Message6354

Author rouilj
Recipients ThomasAH, ced, rouilj, schlatterbeck, tekberg
Date 2019-02-18.12:46:03
Message-id <20190218124548.789AE4C0385@itserver6.localdomain>
In-reply-to <20190218083840.565620063.thomas@intevation.de>
Hi Thomas:

In message <20190218083840.565620063.thomas@intevation.de>,
Thomas Arendsen Hein writes:
>* John P. Rouillard <rouilj@cs.umb.edu> [20190217 16:50]:
>> In message <1550402207.92.0.371676542223.issue2551023@roundup.psfhosted.org>,
>> =?utf-8?q?C=C3=A9dric_Krier?= writes:
>> >I use the wsgi_handler instead of roundup-server. And I can not get
>> >HTTP_X-REQUESTED-WITH set in environment because WSGI server convert all
>> >'-' into '_'.
>> 
>> What server are you using? That translation of '-' to _' is not
>> right/supported according to mod_wsgi or wsgi docs. It also seriously
>> breaks the compatibility with CGI.

Ok, I was talking nonsense.

>On the other hand I get variables like HTTP_USER_AGENT or
>HTTP_X_FORWARDED_FOR in a non-python CGI environment, too.

>I just checked 
>
>From https://www.ietf.org/rfc/rfc3875:
>(The Common Gateway Interface (CGI) Version 1.1)
>
>| 4.1.18.  Protocol-Specific Meta-Variables
>|
>|    Meta-variables with names beginning with "HTTP_" contain values read
>|    from the client request header fields, if the protocol used is HTTP.
>|    The HTTP header field name is converted to upper case, has all
>|    occurrences of "-" replaced with "_" and has "HTTP_" prepended to
>|    give the meta-variable name.
>

Ok, so I totally misremebered this.

>>Cedric said:
>> >I think roundup-server behavior should be normalized with other WSGI
>> >server and not use '-' in HTTP_*.
>> >I could not find in PEP3333 that '-' should be converted into '_' for
>> >HTTP_. There is only a reference to server-defined variables.
>> >
>> >https://www.python.org/dev/peps/pep-3333/#environ-variables
>> 

Apparently I implemented the wrong thing. I must have misconfigued my
test where I ran roundup as a pure cgi script. Worse, I relied on my
memory rather than looking up the cgi spec when I answered this
originally 8-(.

I agree 100% with Cedric's proposal to replace - with _ in roundup
server's mapping of HTTP headers into variables and changing the code
to match the _ form.

Thanks for the correction Thomas.
History
Date User Action Args
2019-02-18 12:46:03rouiljsetrecipients: + rouilj, schlatterbeck, ced
2019-02-18 12:46:03rouiljlinkissue2551023 messages
2019-02-18 12:46:03rouiljcreate