In an old project using jQuery, I pass a header, but the header received bask side has a different name (a different key).
Front, js side:
options.headers['X-CSRF-TOKEN'] = CSRFToken;
Back, php side
$servers = array();
foreach ($_SERVER as $k=>$v) {
if (strpos(strtolower($k), 'csrf')) {
$servers[] = "$k: $v";
}
}
var_dump($servers);
Is actually printing
HTTP_X_CSRF_TOKEN: ARandomTokenWeDontCareAbout
Yes, I'm quite sure that this headers is passed at this point, if I remove the js part, HTTP_... disappear.
Is it normal, can I avoid this behaviour, should I deal with it ?
Jquery 2.2, PHP 7.4