|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65943 Blank headers missing with apache_request_headers
Submitted: 2013-10-22 01:48 UTC Modified: 2013-10-22 22:37 UTC
From: jgotts at gmail dot com Assigned:
Status: Closed Package: Apache related
PHP Version: 5.4.21 OS: Linux
Private report: No CVE-ID: None
 [2013-10-22 01:48 UTC] jgotts at gmail dot com
It appears that apache_request_headers won't return blank headers. The key for said header is missing from the associative array. We have something quite simple on the JavaScript side:

var xhr = new XMLHttpRequest();
xhr.setRequestHeader('my-header', '');

Nothing in disallows a blank second argument for setRequestHeader().

And on the PHP side, we have:

$headers = apache_request_headers();

$headers['my-header'] is missing! What ate it?


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-10-22 22:37 UTC] jgotts at gmail dot com
-Status: Open +Status: Closed
 [2013-10-22 22:37 UTC] jgotts at gmail dot com
I'm going to close this bug because it's a bug in XMLHttpRequest::setRequestHeader() in Firefox 24, not in PHP.

PHP does the right thing when I explicitly set a blank header like this:

curl -k -H "my-header;"






    [User-Agent] => curl/7.27.0
    [Host] =>
    [Accept] => */*
    [my-header] => 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jul 14 18:01:29 2024 UTC