ID: 48777
Comment by: ld at e dot pl
Reported By: jeff_dafoe at harte-hanks dot com
Status: Open
Bug Type: SOAP related
Operating System: Linux
PHP Version: 5.2.10
New Comment:
This patch you made doesn't make sense for most applications.
Simply you put:
if (use_http_error_status) {
sapi_add_header("HTTP/1.1 500 Internal Service Error",
sizeof("HTTP/1.1 500 Internal Service Error")-1, 1);
}
but use_http_error_status is false only if HTTP_USER_AGENT=='Shockwave
Flash' what it's only true if you are using AIR standalone but if you
have embeded Flex code into a webpage then you HTTP_USER_AGENT is a
browser one not the Shackwave Flash.
Could you go here for something simpler like setting for SoapServer
class telling the system if you want this HTTP 500 or not?
Previous Comments:
------------------------------------------------------------------------
[2009-07-02 13:53:12] jeff_dafoe at harte-hanks dot com
Description:
------------
Bug #43507 describes an issue with Adobe Flex / Flash / Air where the
host browser does not pass the HTTP response body down to the Flash
player when the browser receives a HTTP status code of 500. The bug
suggests that the ability to set the HTTP status code be allowed. The
fix that was decided on instead was to look for the user agent string
"Shockwave Flash".
The issue with this solution is that the player's requests either never
did, only do on some platforms, or no longer contain this user agent
string. The player's requests contain the user agent string associated
with the host browser. AIR requests (a platform where the host browser
is integrated into the Flash plugin, essentially) contain the Webkit UA
string.
To work around this we have patched soap.c's soap_server_fault_ex to
set use_http_error_status to 0. Ideally, this setting could be exposed
in the SoapServer constructor's "options" or "features". Since this is
a workaround for a limitation in web browser's NAPI and not a problem
with the SOAP library itself, making the use_http_error_status available
as an option seems like an acceptable compromise.
Reproduce code:
---------------
throw new SoapFault('Client', $_SERVER['HTTP_USER_AGENT']);
Expected result:
----------------
HTTP/1.1 200 OK
Actual result:
--------------
HTTP/1.1 500 Internal Service Error
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=48777&edit=1