3 ms·
> As a relic of the CGI spec, a header called "Foo" would be turned into an array index called "HTTP_FOO". Usually, yes. But CGI has some headers that don't ge
by TazeTSchnitzel 11y ago
> As a relic of the CGI spec, a header called "Foo" would be turned into an array index called "HTTP_FOO".
Usually, yes. But CGI has some headers that don't get that prefix, things like "CONTENT_LENGTH".
It looks to me like whoever added the HTTPS variable feature to Apache implemented it as an unprefixed header rather than a proper CGI variable, for some reason, and that's the issue.
That, or it is a CGI var, but some error in Apache allows HTTP headers to set it.
- pilif 11y agoI would have said that content_length is special in that it's supposed to be the actual content length, not the value sent by the client in the header. But I definitely defer to your wisdom as I'm just a user who hasn't done pure CGI in 15 years. As somebody who works on PHP, you are probably infinitely more qualified
- TazeTSchnitzel 11y agoYou have a point there. If the request body was weird and lacked the header somehow, I suppose CONTENT_LENGTH would still be there.