if (c = http_message_header(msg, "Content-Range")) {
ulong total = 0, start = 0, end = 0, len = 0;
- if (!strncasecmp(Z_STRVAL_P(c), "bytes=", lenof("bytes="))) {
+ if (!strncasecmp(Z_STRVAL_P(c), "bytes", lenof("bytes")) &&
+ (Z_STRVAL_P(c)[lenof("bytes")] == '=' || Z_STRVAL_P(c)[lenof("bytes")] == ' ')) {
char *total_at = NULL, *end_at = NULL;
char *start_at = Z_STRVAL_P(c) + lenof("bytes=");
* Fixed a bug that caused a warning about an invalid curl handle at HttpRequestPool destruction
* Fixed a bug with http_get_request_headers() modifying $_SERVER array
+* Fixed a bug which required "=" in Content-Range response message headers
]]></notes>
<contents>
<dir name="/">
--- /dev/null
+--TEST--
+http_parse_message() content range header w/(o) =
+--SKIPIF--
+<?php
+include 'skip.inc';
+?>
+--FILE--
+<?php
+echo "-TEST\n";
+print_r(http_parse_message(
+"
+HTTP/1.1 206
+Server: Funky/1.0
+Content-Range: bytes=0-0/100
+
+1
+
+HTTP/1.1 206
+Server: Funky/1.0
+Content-Range: bytes 0-0/100
+
+1
+
+"
+));
+echo "Done\n";
+?>
+--EXPECTF--
+%sTEST
+stdClass Object
+(
+ [type] => 2
+ [httpVersion] => 1.1
+ [responseCode] => 206
+ [responseStatus] =>
+ [headers] => Array
+ (
+ [Server] => Funky/1.0
+ [Content-Range] => bytes 0-0/100
+ )
+
+ [body] => 1
+ [parentMessage] => stdClass Object
+ (
+ [type] => 2
+ [httpVersion] => 1.1
+ [responseCode] => 206
+ [responseStatus] =>
+ [headers] => Array
+ (
+ [Server] => Funky/1.0
+ [Content-Range] => bytes=0-0/100
+ )
+
+ [body] => 1
+ [parentMessage] =>
+ )
+
+)
+Done