Correctly parse Range headers with multiple ranges that have
whitespaces around the comma separating the ranges from each other by
trimming the whitespace.
PR: 69831
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@
1928901 13f79535-47bb-0310-9956-
ffa450edef68
--- /dev/null
+ *) http: Correctly parse Range headers with multiple ranges that have
+ whitespaces around the comma separating the ranges from each other.
+ PR 69831 [Ruediger Pluem]
}
*indexes = apr_array_make(r->pool, ranges, sizeof(indexes_t));
while ((cur = ap_getword(r->pool, &range, ','))) {
- char *dash;
+ char *dash, *end_cur;
apr_off_t number, start, end;
+ /* Remove leading and trailing white spaces */
+ while (apr_isspace(*cur))
+ ++cur;
+ /* blast trailing whitespace */
+ end_cur = &cur[strlen(cur)];
+ while (--end_cur >= cur && apr_isspace(*end_cur))
+ *end_cur = '\0';
+
if (!*cur)
break;