From 33b7c5dcd9cffebb8486cb57e04958e34bbfe662 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Mon, 12 Dec 2005 12:36:18 +0000 Subject: [PATCH] - made the silently failing message parser raise some errors - split http_request_reset into itself and http_request_defaults - made detection of leaks caused thrugh request bodies easier - provide the url of errenous requests in request_pool_perform() - only append port if it is not 0 to uri - fixup tests --- http_encoding_api.c | 2 + http_message_api.c | 4 +- http_request_api.c | 165 +++++++++++++++++++-------------- http_request_body_api.c | 4 +- http_request_pool_api.c | 4 +- http_url_api.c | 9 +- php_http_request_api.h | 3 + php_http_request_body_api.h | 4 +- tests/HttpMessage_001.phpt | 6 +- tests/HttpMessage_003.phpt | 3 +- tests/HttpRequestPool_005.phpt | 2 +- tests/HttpRequest_002.phpt | 5 +- tests/exceptions.phpt | 4 +- tests/parse_message_002.phpt | 2 +- tests/request_gzip.phpt | 10 +- 15 files changed, 136 insertions(+), 91 deletions(-) diff --git a/http_encoding_api.c b/http_encoding_api.c index 080c16c..d3529d1 100644 --- a/http_encoding_api.c +++ b/http_encoding_api.c @@ -74,6 +74,8 @@ PHP_HTTP_API const char *_http_encoding_dechunk(const char *encoded, size_t enco /* reached the end */ if (!chunk_len) { + /* move over '0' chunked encoding terminator */ + while (*e_ptr == '0') ++e_ptr; break; } diff --git a/http_message_api.c b/http_message_api.c index 5a2302b..608e4f0 100644 --- a/http_message_api.c +++ b/http_message_api.c @@ -131,6 +131,7 @@ PHP_HTTP_API http_message *_http_message_parse_ex(http_message *msg, const char zend_bool free_msg = msg ? 0 : 1; if ((!message) || (message_length < HTTP_MSG_MIN_SIZE)) { + http_error_ex(HE_WARNING, HTTP_E_INVALID_PARAM, "Empty or too short HTTP message: '%s'", message); return NULL; } @@ -140,9 +141,10 @@ PHP_HTTP_API http_message *_http_message_parse_ex(http_message *msg, const char if (free_msg) { http_message_free(&msg); } + http_error(HE_WARNING, HTTP_E_MALFORMED_HEADERS, "Failed to parse message headers"); return NULL; } - + /* header parsing stops at (CR)LF (CR)LF */ if ((body = http_locate_body(message))) { zval *c; diff --git a/http_request_api.c b/http_request_api.c index 3528d3c..9ea1902 100644 --- a/http_request_api.c +++ b/http_request_api.c @@ -29,6 +29,8 @@ # include "php_http_request_object.h" #endif +ZEND_EXTERN_MODULE_GLOBALS(http); + /* {{{ cruft for thread safe SSL crypto locks */ #if defined(ZTS) && defined(HTTP_HAVE_SSL) # ifdef PHP_WIN32 @@ -66,15 +68,14 @@ # endif /* HTTP_HAVE_OPENSSL || HTTP_HAVE_GNUTLS */ # endif /* PHP_WIN32 */ #endif /* ZTS && HTTP_HAVE_SSL */ -/* }}} */ - -ZEND_EXTERN_MODULE_GLOBALS(http); #ifdef HTTP_NEED_SSL_TSL static inline void http_ssl_init(void); static inline void http_ssl_cleanup(void); #endif +/* }}} */ +/* {{{ MINIT */ PHP_MINIT_FUNCTION(http_request) { #ifdef HTTP_NEED_SSL_TSL @@ -92,7 +93,9 @@ PHP_MINIT_FUNCTION(http_request) return SUCCESS; } +/* }}} */ +/* {{{ MSHUTDOWN */ PHP_MSHUTDOWN_FUNCTION(http_request) { curl_global_cleanup(); @@ -101,7 +104,9 @@ PHP_MSHUTDOWN_FUNCTION(http_request) #endif return SUCCESS; } +/* }}} */ +/* {{{ MACROS */ #ifndef HAVE_CURL_EASY_STRERROR # define curl_easy_strerror(dummy) "unkown error" #endif @@ -182,7 +187,9 @@ PHP_MSHUTDOWN_FUNCTION(http_request) key = NULL; \ continue; \ } +/* }}} */ +/* {{{ forward declarations */ #define http_request_option(r, o, k, t) _http_request_option_ex((r), (o), (k), sizeof(k), (t) TSRMLS_CC) #define http_request_option_ex(r, o, k, l, t) _http_request_option_ex((r), (o), (k), (l), (t) TSRMLS_CC) static inline zval *_http_request_option_ex(http_request *request, HashTable *options, char *key, size_t keylen, int type TSRMLS_DC); @@ -192,7 +199,9 @@ static int http_curl_progress_callback(void *, double, double, double, double); static int http_curl_raw_callback(CURL *, curl_infotype, char *, size_t, void *); static int http_curl_dummy_callback(char *data, size_t n, size_t l, void *s) { return n*l; } static curlioerr http_curl_ioctl_callback(CURL *, curliocmd, void *); +/* }}} */ +/* {{{ http_request *http_request_init(http_request *) */ PHP_HTTP_API http_request *_http_request_init_ex(http_request *request, CURL *ch, http_request_method meth, const char *url TSRMLS_DC) { http_request *r; @@ -220,7 +229,9 @@ PHP_HTTP_API http_request *_http_request_init_ex(http_request *request, CURL *ch return r; } +/* }}} */ +/* {{{ void http_request_dtor(http_request *) */ PHP_HTTP_API void _http_request_dtor(http_request *request) { TSRMLS_FETCH_FROM_CTX(request->tsrm_ls); @@ -235,11 +246,7 @@ PHP_HTTP_API void _http_request_dtor(http_request *request) request->ch = NULL; } - STR_SET(request->url, NULL); - - request->conv.last_type = 0; - phpstr_dtor(&request->conv.request); - phpstr_dtor(&request->conv.response); + http_request_reset(request); zend_hash_destroy(&request->info); @@ -250,7 +257,9 @@ PHP_HTTP_API void _http_request_dtor(http_request *request) request->_cache.headers = NULL; } } +/* }}} */ +/* {{{ void http_request_free(http_request **) */ PHP_HTTP_API void _http_request_free(http_request **request) { if (*request) { @@ -260,79 +269,90 @@ PHP_HTTP_API void _http_request_free(http_request **request) *request = NULL; } } +/* }}} */ -/* {{{ http_request_reset(http_request *) */ +/* {{{ void http_request_reset(http_request *) */ PHP_HTTP_API void _http_request_reset(http_request *request) { -#ifdef HAVE_CURL_EASY_RESET - curl_easy_reset(request->ch); -#endif - + TSRMLS_FETCH_FROM_CTX(request->tsrm_ls); STR_SET(request->url, NULL); + request->conv.last_type = 0; phpstr_dtor(&request->conv.request); phpstr_dtor(&request->conv.response); + http_request_body_free(&request->body); +} +/* }}} */ +/* {{{ void http_request_defaults(http_request *) */ +PHP_HTTP_API void _http_request_defaults(http_request *request) +{ + if (request->ch) { +#ifdef HAVE_CURL_EASY_RESET + curl_easy_reset(request->ch); +#endif #if defined(ZTS) - HTTP_CURL_OPT(NOSIGNAL, 1); + HTTP_CURL_OPT(NOSIGNAL, 1); #endif - HTTP_CURL_OPT(HEADER, 0); - HTTP_CURL_OPT(FILETIME, 1); - HTTP_CURL_OPT(AUTOREFERER, 1); - HTTP_CURL_OPT(VERBOSE, 1); - HTTP_CURL_OPT(HEADERFUNCTION, NULL); - HTTP_CURL_OPT(DEBUGFUNCTION, http_curl_raw_callback); - HTTP_CURL_OPT(READFUNCTION, http_curl_read_callback); - HTTP_CURL_OPT(IOCTLFUNCTION, http_curl_ioctl_callback); - HTTP_CURL_OPT(WRITEFUNCTION, http_curl_dummy_callback); - HTTP_CURL_OPT(URL, NULL); - HTTP_CURL_OPT(NOPROGRESS, 1); - HTTP_CURL_OPT(PROXY, NULL); - HTTP_CURL_OPT(PROXYPORT, 0); - HTTP_CURL_OPT(PROXYUSERPWD, NULL); - HTTP_CURL_OPT(PROXYAUTH, 0); - HTTP_CURL_OPT(INTERFACE, NULL); - HTTP_CURL_OPT(PORT, 0); - HTTP_CURL_OPT(USERPWD, NULL); - HTTP_CURL_OPT(HTTPAUTH, 0); - HTTP_CURL_OPT(ENCODING, 0); - HTTP_CURL_OPT(FOLLOWLOCATION, 0); - HTTP_CURL_OPT(UNRESTRICTED_AUTH, 0); - HTTP_CURL_OPT(REFERER, NULL); - HTTP_CURL_OPT(USERAGENT, "PECL::HTTP/" PHP_EXT_HTTP_VERSION " (PHP/" PHP_VERSION ")"); - HTTP_CURL_OPT(HTTPHEADER, NULL); - HTTP_CURL_OPT(COOKIE, NULL); - HTTP_CURL_OPT(COOKIEFILE, NULL); - HTTP_CURL_OPT(COOKIEJAR, NULL); - HTTP_CURL_OPT(RESUME_FROM, 0); - HTTP_CURL_OPT(MAXFILESIZE, 0); - HTTP_CURL_OPT(TIMECONDITION, 0); - HTTP_CURL_OPT(TIMEVALUE, 0); - HTTP_CURL_OPT(TIMEOUT, 0); - HTTP_CURL_OPT(CONNECTTIMEOUT, 3); - HTTP_CURL_OPT(SSLCERT, NULL); - HTTP_CURL_OPT(SSLCERTTYPE, NULL); - HTTP_CURL_OPT(SSLCERTPASSWD, NULL); - HTTP_CURL_OPT(SSLKEY, NULL); - HTTP_CURL_OPT(SSLKEYTYPE, NULL); - HTTP_CURL_OPT(SSLKEYPASSWD, NULL); - HTTP_CURL_OPT(SSLENGINE, NULL); - HTTP_CURL_OPT(SSLVERSION, 0); - HTTP_CURL_OPT(SSL_VERIFYPEER, 0); - HTTP_CURL_OPT(SSL_VERIFYHOST, 0); - HTTP_CURL_OPT(SSL_CIPHER_LIST, NULL); - HTTP_CURL_OPT(CAINFO, NULL); - HTTP_CURL_OPT(CAPATH, NULL); - HTTP_CURL_OPT(RANDOM_FILE, NULL); - HTTP_CURL_OPT(EGDSOCKET, NULL); - HTTP_CURL_OPT(POSTFIELDS, NULL); - HTTP_CURL_OPT(POSTFIELDSIZE, 0); - HTTP_CURL_OPT(HTTPPOST, NULL); - HTTP_CURL_OPT(IOCTLDATA, NULL); - HTTP_CURL_OPT(READDATA, NULL); - HTTP_CURL_OPT(INFILESIZE, 0); + HTTP_CURL_OPT(HEADER, 0); + HTTP_CURL_OPT(FILETIME, 1); + HTTP_CURL_OPT(AUTOREFERER, 1); + HTTP_CURL_OPT(VERBOSE, 1); + HTTP_CURL_OPT(HEADERFUNCTION, NULL); + HTTP_CURL_OPT(DEBUGFUNCTION, http_curl_raw_callback); + HTTP_CURL_OPT(READFUNCTION, http_curl_read_callback); + HTTP_CURL_OPT(IOCTLFUNCTION, http_curl_ioctl_callback); + HTTP_CURL_OPT(WRITEFUNCTION, http_curl_dummy_callback); + HTTP_CURL_OPT(URL, NULL); + HTTP_CURL_OPT(NOPROGRESS, 1); + HTTP_CURL_OPT(PROXY, NULL); + HTTP_CURL_OPT(PROXYPORT, 0); + HTTP_CURL_OPT(PROXYUSERPWD, NULL); + HTTP_CURL_OPT(PROXYAUTH, 0); + HTTP_CURL_OPT(INTERFACE, NULL); + HTTP_CURL_OPT(PORT, 0); + HTTP_CURL_OPT(USERPWD, NULL); + HTTP_CURL_OPT(HTTPAUTH, 0); + HTTP_CURL_OPT(ENCODING, 0); + HTTP_CURL_OPT(FOLLOWLOCATION, 0); + HTTP_CURL_OPT(UNRESTRICTED_AUTH, 0); + HTTP_CURL_OPT(REFERER, NULL); + HTTP_CURL_OPT(USERAGENT, "PECL::HTTP/" PHP_EXT_HTTP_VERSION " (PHP/" PHP_VERSION ")"); + HTTP_CURL_OPT(HTTPHEADER, NULL); + HTTP_CURL_OPT(COOKIE, NULL); + HTTP_CURL_OPT(COOKIEFILE, NULL); + HTTP_CURL_OPT(COOKIEJAR, NULL); + HTTP_CURL_OPT(RESUME_FROM, 0); + HTTP_CURL_OPT(MAXFILESIZE, 0); + HTTP_CURL_OPT(TIMECONDITION, 0); + HTTP_CURL_OPT(TIMEVALUE, 0); + HTTP_CURL_OPT(TIMEOUT, 0); + HTTP_CURL_OPT(CONNECTTIMEOUT, 3); + HTTP_CURL_OPT(SSLCERT, NULL); + HTTP_CURL_OPT(SSLCERTTYPE, NULL); + HTTP_CURL_OPT(SSLCERTPASSWD, NULL); + HTTP_CURL_OPT(SSLKEY, NULL); + HTTP_CURL_OPT(SSLKEYTYPE, NULL); + HTTP_CURL_OPT(SSLKEYPASSWD, NULL); + HTTP_CURL_OPT(SSLENGINE, NULL); + HTTP_CURL_OPT(SSLVERSION, 0); + HTTP_CURL_OPT(SSL_VERIFYPEER, 0); + HTTP_CURL_OPT(SSL_VERIFYHOST, 0); + HTTP_CURL_OPT(SSL_CIPHER_LIST, NULL); + HTTP_CURL_OPT(CAINFO, NULL); + HTTP_CURL_OPT(CAPATH, NULL); + HTTP_CURL_OPT(RANDOM_FILE, NULL); + HTTP_CURL_OPT(EGDSOCKET, NULL); + HTTP_CURL_OPT(POSTFIELDS, NULL); + HTTP_CURL_OPT(POSTFIELDSIZE, 0); + HTTP_CURL_OPT(HTTPPOST, NULL); + HTTP_CURL_OPT(IOCTLDATA, NULL); + HTTP_CURL_OPT(READDATA, NULL); + HTTP_CURL_OPT(INFILESIZE, 0); + } } /* }}} */ +/* {{{ STATUS http_request_prepare(http_request *, HashTable *) */ PHP_HTTP_API STATUS _http_request_prepare(http_request *request, HashTable *options) { zval *zoption; @@ -342,9 +362,12 @@ PHP_HTTP_API STATUS _http_request_prepare(http_request *request, HashTable *opti HTTP_CHECK_CURL_INIT(request->ch, curl_easy_init(), return FAILURE); + http_request_defaults(request); + /* set options */ HTTP_CURL_OPT(DEBUGDATA, request); HTTP_CURL_OPT(URL, request->url); + HTTP_CURL_OPT(PRIVATE, request->url); /* progress callback * / if ((zoption = http_request_option(request, options, "onprogress", 0))) { @@ -627,6 +650,7 @@ PHP_HTTP_API STATUS _http_request_prepare(http_request *request, HashTable *opti } /* }}} */ +/* {{{ void http_request_exec(http_request *) */ PHP_HTTP_API void _http_request_exec(http_request *request) { CURLcode result; @@ -636,8 +660,9 @@ PHP_HTTP_API void _http_request_exec(http_request *request) http_error_ex(HE_WARNING, HTTP_E_REQUEST, "%s (%s)", curl_easy_strerror(result), request->url); } } +/* }}} */ -/* {{{ void http_request_info(CURL *, HashTable *) */ +/* {{{ void http_request_info(http_request *, HashTable *) */ PHP_HTTP_API void _http_request_info(http_request *request, HashTable *info) { zval array; diff --git a/http_request_body_api.c b/http_request_body_api.c index f797141..bde3f8e 100644 --- a/http_request_body_api.c +++ b/http_request_body_api.c @@ -28,9 +28,9 @@ ZEND_EXTERN_MODULE_GLOBALS(http); /* {{{ http_request_body *http_request_body_new() */ -PHP_HTTP_API http_request_body *_http_request_body_new(TSRMLS_D) +PHP_HTTP_API http_request_body *_http_request_body_new(TSRMLS_D ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) { - return (http_request_body *) ecalloc(1, sizeof(http_request_body)); + return (http_request_body *) ecalloc_rel(1, sizeof(http_request_body)); } /* }}} */ diff --git a/http_request_pool_api.c b/http_request_pool_api.c index 6bc4353..191ab44 100644 --- a/http_request_pool_api.c +++ b/http_request_pool_api.c @@ -256,7 +256,9 @@ PHP_HTTP_API int _http_request_pool_perform(http_request_pool *pool TSRMLS_DC) if (CURLMSG_DONE == msg->msg) { if (CURLE_OK != msg->data.result) { http_request_pool_try { - http_error(HE_WARNING, HTTP_E_REQUEST, curl_easy_strerror(msg->data.result)); + char *url = NULL; + curl_easy_getinfo(msg->easy_handle, CURLINFO_PRIVATE, &url); + http_error_ex(HE_WARNING, HTTP_E_REQUEST, "%s (%s)", curl_easy_strerror(msg->data.result), url); } http_request_pool_catch(); } http_request_pool_try { diff --git a/http_url_api.c b/http_url_api.c index 882c390..4f20de5 100644 --- a/http_url_api.c +++ b/http_url_api.c @@ -71,7 +71,7 @@ PHP_HTTP_API char *_http_absolute_url_ex( } else if (purl->scheme) { furl.scheme = purl->scheme; #if defined(PHP_WIN32) || defined(HAVE_NETDB_H) - } else if (port && (se = getservbyport(htons(port), "tcp"))) { + } else if (port && (se = getservbyport(htons((short) port), "tcp"))) { furl.scheme = (scheme = estrdup(se->s_name)); #endif } else { @@ -136,12 +136,13 @@ PHP_HTTP_API char *_http_absolute_url_ex( HTTP_URI_STRLCATL(URL, full_len, furl.host); - if (( (!strcmp(furl.scheme, "http") && (furl.port != 80)) || + if (furl.port && ( + (!strcmp(furl.scheme, "http") && (furl.port != 80)) || (!strcmp(furl.scheme, "https") && (furl.port != 443)) #if defined(PHP_WIN32) || defined(HAVE_NETDB_H) - || ((!(se = getservbyname(furl.scheme, "tcp"))) || (ntohs(se->s_port) != furl.port)) + || ((!(se = getservbyname(furl.scheme, "tcp"))) || (ntohs(se->s_port) != furl.port)) #endif - ) && furl.port) { + )) { char port_string[8] = {0}; snprintf(port_string, 7, ":%u", furl.port); HTTP_URI_STRLCATL(URL, full_len, port_string); diff --git a/php_http_request_api.h b/php_http_request_api.h index 4a2de45..fc6a8e5 100644 --- a/php_http_request_api.h +++ b/php_http_request_api.h @@ -62,6 +62,9 @@ PHP_HTTP_API void _http_request_free(http_request **request); #define http_request_reset(r) _http_request_reset(r) PHP_HTTP_API void _http_request_reset(http_request *r); +#define http_request_defaults(r) _http_request_defaults(r) +PHP_HTTP_API void _http_request_defaults(http_request *request); + #define http_request_prepare(r, o) _http_request_prepare((r), (o)) PHP_HTTP_API STATUS _http_request_prepare(http_request *request, HashTable *options); diff --git a/php_http_request_body_api.h b/php_http_request_body_api.h index cd6f6a4..4b2dd18 100644 --- a/php_http_request_body_api.h +++ b/php_http_request_body_api.h @@ -26,8 +26,8 @@ typedef struct { size_t size; } http_request_body; -#define http_request_body_new() _http_request_body_new(TSRMLS_C) -PHP_HTTP_API http_request_body *_http_request_body_new(TSRMLS_D); +#define http_request_body_new() _http_request_body_new(TSRMLS_C ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) +PHP_HTTP_API http_request_body *_http_request_body_new(TSRMLS_D ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC); #define http_request_body_fill(b, fields, files) _http_request_body_fill((b), (fields), (files) TSRMLS_CC) PHP_HTTP_API STATUS _http_request_body_fill(http_request_body *body, HashTable *fields, HashTable *files TSRMLS_DC); diff --git a/tests/HttpMessage_001.phpt b/tests/HttpMessage_001.phpt index 1ceda68..6791bc3 100644 --- a/tests/HttpMessage_001.phpt +++ b/tests/HttpMessage_001.phpt @@ -33,18 +33,20 @@ echo "Done\n"; --EXPECTF-- %sTEST string(1) "X" -string(135) "HTTP/1.1 301 +string(174) "HTTP/1.1 301 Location: /anywhere HTTP/1.1 302 Location: /somewhere HTTP/1.1 206 Content-Range: bytes=2-3 +X-Original-Transfer-Encoding: chunked Content-Length: 1 X " -string(64) "HTTP/1.1 206 +string(103) "HTTP/1.1 206 Content-Range: bytes=2-3 +X-Original-Transfer-Encoding: chunked Content-Length: 1 X diff --git a/tests/HttpMessage_003.phpt b/tests/HttpMessage_003.phpt index 79d0dc6..7caf206 100644 --- a/tests/HttpMessage_003.phpt +++ b/tests/HttpMessage_003.phpt @@ -33,11 +33,12 @@ echo "Done\n"; --EXPECTF-- %sTEST int(3) -string(109) "HTTP/1.1 301 +string(148) "HTTP/1.1 301 Location: /anywhere HTTP/1.1 302 Location: /somewhere HTTP/1.1 200 +X-Original-Transfer-Encoding: chunked Content-Length: 1 X diff --git a/tests/HttpRequestPool_005.phpt b/tests/HttpRequestPool_005.phpt index 182f662..1978267 100644 --- a/tests/HttpRequestPool_005.phpt +++ b/tests/HttpRequestPool_005.phpt @@ -39,8 +39,8 @@ echo "Done\n"; ?> --EXPECTF-- %sTEST -int(1) int(2) +int(4) int(1) int(2) Done diff --git a/tests/HttpRequest_002.phpt b/tests/HttpRequest_002.phpt index ff8ab00..5913f8c 100644 --- a/tests/HttpRequest_002.phpt +++ b/tests/HttpRequest_002.phpt @@ -33,7 +33,7 @@ Array ( [effective_url] => http://www.google.com/ [response_code] => %d - [http_connectcode] => %d + [connect_code] => %d [filetime] => %s [total_time] => %f [namelookup_time] => %f @@ -49,11 +49,14 @@ Array [header_size] => %d [request_size] => %d [ssl_verifyresult] => %d + [ssl_engines] => Array%s [content_length_download] => %d [content_length_upload] => %d [content_type] => %s [httpauth_avail] => %d [proxyauth_avail] => %s + [num_connects] => %d + [cookies] => Array%s ) Array ( diff --git a/tests/exceptions.phpt b/tests/exceptions.phpt index 43bb190..8e9ea5d 100644 --- a/tests/exceptions.phpt +++ b/tests/exceptions.phpt @@ -41,7 +41,7 @@ if (http_support(HTTP_SUPPORT_REQUESTS)) { printf("%s (%d)\n", $x->getMessage(), $x->getCode()); } } else { - echo "URL using bad/illegal format or missing URL (8)\n"; + echo "URL using bad/illegal format or missing URL ((null)) (8)\n"; } echo "Done\n"; ?> @@ -59,5 +59,5 @@ echo "Done\n"; 10: HttpSocketException 11: HttpResponseException 12: HttpUrlException -URL using bad/illegal format or missing URL (8) +URL using bad/illegal format or missing URL ((null)) (8) Done diff --git a/tests/parse_message_002.phpt b/tests/parse_message_002.phpt index d82aac9..281215d 100644 --- a/tests/parse_message_002.phpt +++ b/tests/parse_message_002.phpt @@ -13,7 +13,7 @@ $message = "Transfer-Encoding: identity\n". "Content-Length: 3\n". "Content-Type: text/plain\n\n". -"Hi!foo"; +"Hi!\n\n\n\n"; print_r(http_parse_message($message)); diff --git a/tests/request_gzip.phpt b/tests/request_gzip.phpt index c4d3a12..c947f62 100644 --- a/tests/request_gzip.phpt +++ b/tests/request_gzip.phpt @@ -25,14 +25,18 @@ object(stdClass)#%d (%d) { ["responseStatus"]=> string(2) "OK" ["headers"]=> - array(6) { + array(8) { %s ["Vary"]=> string(15) "Accept-Encoding" - ["Content-Type"]=> - string(9) "text/html" ["Content-Length"]=> string(2) "27" + ["Content-Type"]=> + string(9) "text/html" + ["X-Original-Content-Encoding"]=> + string(4) "gzip" + ["X-Original-Content-Length"]=> + string(2) "52" } ["body"]=> string(27) "Array -- 2.30.2