From: Michael Wallner Date: Wed, 5 Apr 2006 16:34:28 +0000 (+0000) Subject: - skip leading ws in http_parse_headers() X-Git-Tag: RELEASE_1_0_0RC3~14 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=687515f3fa8863f97fd281152a80171ad438532d;p=m6w6%2Fext-http - skip leading ws in http_parse_headers() --- diff --git a/http_headers_api.c b/http_headers_api.c index fd94d8e..70f36ce 100644 --- a/http_headers_api.c +++ b/http_headers_api.c @@ -326,11 +326,15 @@ PHP_HTTP_API http_range_status _http_get_request_ranges(HashTable *ranges, size_ PHP_HTTP_API STATUS _http_parse_headers_ex(const char *header, HashTable *headers, zend_bool prettify, http_info_callback callback_func, void **callback_data TSRMLS_DC) { - const char *colon = NULL, *line = header; + const char *colon = NULL, *line = NULL; zval array; INIT_ZARR(array, headers); + /* skip leading ws */ + while (isspace(*header)) ++header; + line = header; + #define MORE_HEADERS (*(line-1) && !(*(line-1) == '\n' && (*line == '\n' || *line == '\r'))) do { int value_len = 0;