From 687515f3fa8863f97fd281152a80171ad438532d Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Wed, 5 Apr 2006 16:34:28 +0000 Subject: [PATCH] - skip leading ws in http_parse_headers() --- http_headers_api.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; -- 2.30.2