|  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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: jgotts at gmail dot com
New email:
PHP Version: OS:


 [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: Sat Jul 20 13:01:27 2024 UTC