Re: [Web-SIG] HTTP_CONTENT_TYPE and HTTP_CONTENT_LENGTH

2007-12-12 Thread Manlio Perillo
Ian Bicking ha scritto: > Manlio Perillo wrote: > > [...] > the Content-Type header should be > CONTENT_TYPE, and Content-Length should be CONTENT_LENGTH. This is just a personal curiosity: *why* CGI defines these additional variables instead of using the corresponding HTTP_ variables? The

Re: [Web-SIG] HTTP_CONTENT_TYPE and HTTP_CONTENT_LENGTH

2007-12-12 Thread Manlio Perillo
Phillip J. Eby ha scritto: > At 02:40 PM 12/12/2007 -0600, Ian Bicking wrote: >> Having the same header show up in >> multiple places seems dangerous (where the two values may not match, >> especially if the request has one of those keys rewritten). > > I agree -- this probably should be added to

Re: [Web-SIG] HTTP_CONTENT_TYPE and HTTP_CONTENT_LENGTH

2007-12-12 Thread Phillip J. Eby
At 02:40 PM 12/12/2007 -0600, Ian Bicking wrote: >Having the same header show up in >multiple places seems dangerous (where the two values may not match, >especially if the request has one of those keys rewritten). I agree -- this probably should be added to the WSGI spec, because otherwise middl

Re: [Web-SIG] HTTP_CONTENT_TYPE and HTTP_CONTENT_LENGTH

2007-12-12 Thread Manlio Perillo
Ian Bicking ha scritto: > Manlio Perillo wrote: > [...] >> P.S.: I'm reading the cgi module and it only uses argv[1]: >> if sys.argv[1:]: >> qs = sys.argv[1] >> >> I'm not sure to understand. >> >> Moreover in mod_wsgi for nginx, I call PySys_SetArgv, so the WSGI >>

Re: [Web-SIG] HTTP_CONTENT_TYPE and HTTP_CONTENT_LENGTH

2007-12-12 Thread Ian Bicking
Manlio Perillo wrote: >> And of course it's not much code to remove them. There's some things >> that technically are okay with WSGI, but in practice are bad (like >> leaving out QUERY_STRING, which can cause very weird bugs due to how >> the cgi module was written). >> > > QUERY_STRING can be

Re: [Web-SIG] HTTP_CONTENT_TYPE and HTTP_CONTENT_LENGTH

2007-12-12 Thread Manlio Perillo
Ian Bicking ha scritto: > [...] >> >> The gateway is not required to remove HTTP_CONTENT_TYPE and >> HTTP_CONTENT_LENGTH; >> at least this is what CGI says (and WSGI says nothing about this). >> >> In fact in mod_wsgi for Nginx I don't remove these two variables, >> since it requires extra code (

Re: [Web-SIG] HTTP_CONTENT_TYPE and HTTP_CONTENT_LENGTH

2007-12-12 Thread Ian Bicking
Manlio Perillo wrote: > Ian Bicking ha scritto: >> Manlio Perillo wrote: >>> Hi. >>> >>> The CGI spec says: >>> """Servers are not required to create metavariables for all the >>> request header fields that they receive. In particular, they MAY >>> decline to make available any header fields carr

Re: [Web-SIG] HTTP_CONTENT_TYPE and HTTP_CONTENT_LENGTH

2007-12-12 Thread Manlio Perillo
Ian Bicking ha scritto: > Manlio Perillo wrote: >> Hi. >> >> The CGI spec says: >> """Servers are not required to create metavariables for all the >> request header fields that they receive. In particular, they MAY >> decline to make available any header fields carrying authentication >> informa

Re: [Web-SIG] HTTP_CONTENT_TYPE and HTTP_CONTENT_LENGTH

2007-12-12 Thread Ian Bicking
Manlio Perillo wrote: > Hi. > > The CGI spec says: > """Servers are not required to create metavariables for all the request > header fields that they receive. In particular, they MAY decline to make > available any header fields carrying authentication information, such as > "Authorization", o

[Web-SIG] HTTP_CONTENT_TYPE and HTTP_CONTENT_LENGTH

2007-12-12 Thread Manlio Perillo
Hi. The CGI spec says: """Servers are not required to create metavariables for all the request header fields that they receive. In particular, they MAY decline to make available any header fields carrying authentication information, such as "Authorization", or which are available to the script