Page 1 of 1

HTTP Request Headers containing underscores and hyphens

Posted: Mon Aug 10, 2009 5:29 am
by Martian
Hi, I imagine someone has come across this problem before.

I'm receiving custom HTTP headers from a WAP Gateway. The headers contain a mixture of "_" and "-" characters. I have some PHP which does some processing before making an ongoing request to another application. The PHP needs to pass all headers received to the downstream application. However all "-" in header names have been converted to "_" by PHP before being stored in the $_SERVER global. So I don't know which were "-" and which were "_" when I make the ongoing request using the headers stored in $_SERVER.

Any ideas on how to solve this problem would be greatly appreciated.

Re: HTTP Request Headers containing underscores and hyphens

Posted: Mon Aug 10, 2009 7:57 am
by turbolemon
You using Apache? You could try this http://us3.php.net/manual/en/function.a ... eaders.php. It doesn't mention whether or not it mauls the header names, but it's worth a try.

Re: HTTP Request Headers containing underscores and hyphens

Posted: Mon Aug 10, 2009 8:24 am
by Martian
Thanks turbolemon, that did the trick.