HTTP parser bug fix

This commit is contained in:
Chris Boden 2011-11-07 10:17:39 -05:00
parent 0de53cf7ee
commit 1495354e7c

View File

@ -186,7 +186,7 @@ class WebSocket implements ProtocolInterface {
*/ */
protected function http_parse_headers($http_message) { protected function http_parse_headers($http_message) {
$retVal = array(); $retVal = array();
$fields = explode("br", preg_replace("%(<|/\>|>)%", "", nl2br($header))); $fields = explode("br", preg_replace("%(<|/\>|>)%", "", nl2br($http_message)));
foreach ($fields as $field) { foreach ($fields as $field) {
if (preg_match('%^(GET|POST|PUT|DELETE|PATCH)(\s)(.*)%', $field, $matchReq)) { if (preg_match('%^(GET|POST|PUT|DELETE|PATCH)(\s)(.*)%', $field, $matchReq)) {