php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31065 HTTP "302" status header contains no description causing failure on clients.
Submitted: 2004-12-12 15:46 UTC Modified: 2005-03-08 01:00 UTC
Votes:5
Avg. Score:4.6 ± 0.8
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:2 (66.7%)
From: glideraerobatics at hotmail dot com Assigned:
Status: No Feedback Package: HTTP related
PHP Version: 5.0.2 OS: Linux
Private report: No CVE-ID:
Have you experienced this issue?
Rate the importance of this bug to you:

 [2004-12-12 15:46 UTC] glideraerobatics at hotmail dot com
Description:
------------
I've noticed that the browsers in many mobile handsets fail to understand HTTP responses that don't contain a description after the status code.

This is often a problem when using the header('Location: http://somewhere/') function in PHP scripts. This function sets the HTTP status code to 302 so that the client can redirect to the given location. Unfortunately the description "Found" is missing behind that status header so many mobile clients just croak when they recieve the response.

Adding a status description. Just rip them from here:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6



When it comes to what is not following the HTTP standards exactly in this case, then I think it's PHP as I can't see anywhere that the status description is something optional:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6



Reproduce code:
---------------
header('Location: http://www.php.net');


Expected result:
----------------
HTTP/1.1 302 Found
Location: http://www.php.net/


Actual result:
--------------
HTTP/1.1 302
Location: http://www.php.net/


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-12-12 16:35 UTC] iliaa@php.net
What SAPI are you using?
 [2004-12-12 21:24 UTC] glideraerobatics at hotmail dot com
I'm using php-cgi called from mod_suphp in Apache 2.
 [2005-02-28 21:17 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip


 [2005-03-08 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2006-05-18 01:50 UTC] deb dot sites at sbcglobal dot net
I have a similar situation. I am on a windows system, using a dell AXIM running pc windows using the standard IE explorer with cookies on. I, too, cannot seem to get the header:Location to work even though I specify the full link (not relative link). It works fine on my workstations (running windows xp pro - just not on the axim mobile device.
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sat Apr 19 06:02:27 2014 UTC