2

XAMPP Removes HTTP Headers with Underline Characters

 2 years ago
source link: https://www.codesd.com/item/xampp-removes-http-headers-with-underline-characters.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

XAMPP Removes HTTP Headers with Underline Characters

advertisements

I'm trying to get a PHP application to run that relies on a specific browser that supplies additional information via HTTP headers. Specifically, it is the EVE Online ingame browser, but my problem lies in the way XAMPP (specifically XAMPP USB Lite 1.8.0) handles those headers.

What I observed is that the specific header I need (HTTP_EVE_TRUSTED) is not available in $_SERVER when I try it with XAMPP on Windows, but it is there if I use an Apache installation on Debian.

I used a simple script to output the headers:

<?php
print_r($_SERVER);
?>

and only this one header is missing when the script is hosted on XAMPP. I suspect that XAMPP has some strange default configuration that strips certain headers, maybe a security feature, but I can't find anything about that.

On suggestion from Nacerridine I used Tamper Data for Firefox to reproduce the issue and I found that only headers containing underscores are removed.

What could cause this header to be unavailable on XAMPP but not on other servers? And how can I fix this?


I didn't find the exact reason why the header was being removed from the $_SERVER array, but you can still access the the same information using apache_request_headers

$requestHeaders = apache_request_headers();
if ($requestHeaders){
    echo $requestHeaders['EVE_TRUSTED'];
}


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK