Bug #3116 HTTP response message does not contain CRLF
Submitted: 2005年01月05日 19:39 UTC
From: vincent at dauphin-mm dot nl Assigned: cweiske
Status: Closed Package: HTTP_Server
PHP Version: 4.3.9 OS: linux
Roadmaps: (Not assigned)
Subscription


[2005年01月05日 19:39 UTC] vincent at dauphin-mm dot nl
Description: ------------ The function _sendResponse() in class HTTP_Server generates a response where the status-line and headers don't end with CRLF, but only with LF. This can be fix with the following patch: --- Server.php.orig 2005年01月05日 20:38:47.100824286 +0100 +++ Server.php 2005年01月05日 20:37:10.018097924 +0100 @@ -265,7 +265,7 @@ $response["code_translated"] = $this->_resolveStatusCode($response["code"]); // send the response code - $this->_driver->sendData($clientId, sprintf("HTTP/1.0 %s %s\n", $response["code"], $response["code_translated"])); + $this->_driver->sendData($clientId, sprintf("HTTP/1.0 %s %s\r\n", $response["code"], $response["code_translated"])); // check for headers if (!isset($response["headers"]) || (!is_array($response["headers"])) ) { @@ -288,13 +288,13 @@ // send the headers foreach($response["headers"] as $header => $value) { - $this->_driver->sendData($clientId, sprintf("%s: %s\n", $header, $value)); + $this->_driver->sendData($clientId, sprintf("%s: %s\r\n", $header, $value)); } // send the response body if (isset($response["body"])) { - $this->_driver->sendData($clientId, "\n"); + $this->_driver->sendData($clientId, "\r\n"); if (is_string($response["body"])) { $this->_driver->sendData($clientId, $response["body"]); }

Comments

[2005年01月29日 18:42 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE. Write a message to pear-dev@lists.php.net
to request the confirmation link. All bugs/comments/patches associated with this
email address will be deleted within 48 hours if the account request is not confirmed!

AltStyle によって変換されたページ (->オリジナル) /