1
0
mirror of https://github.com/guzzle/guzzle.git synced 2025-02-13 03:45:22 +01:00

[Http] Updating regex to match parts in the status line

This commit is contained in:
Michael Dowling 2011-03-30 11:33:22 -05:00
parent 8f41764d02
commit 09710895c2

View File

@ -82,7 +82,7 @@ class RequestFactory
// Parse each line in the message
foreach (explode("\r\n", $parts[0]) as $line) {
$matches = array();
if (preg_match('#^(?<method>GET|POST|PUT|HEAD|DELETE|TRACE|OPTIONS)\s+(?<path>/.*)\s+(?<protocol>\w+)/(?<version>\d\.\d)\s*$#i', $line, $matches)) {
if (preg_match('#^(?P<method>GET|POST|PUT|HEAD|DELETE|TRACE|OPTIONS)\s+(?P<path>/.*)\s+(?P<protocol>\w+)/(?P<version>\d\.\d)\s*$#i', $line, $matches)) {
$method = strtoupper($matches['method']);
$protocol = strtoupper($matches['protocol']);
$path = $matches['path'];