X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=php_http_message.c;h=8c1f40ccbd077da096d6037d02a298a78014ceae;hb=7da592d8df565f11e666faa0ab41090f826156c3;hp=0ffdd9e5002572110231e9fd768554a332934af1;hpb=5a7615a3e3b5c56471b19941332ba18830778bfb;p=m6w6%2Fext-http diff --git a/php_http_message.c b/php_http_message.c index 0ffdd9e..8c1f40c 100644 --- a/php_http_message.c +++ b/php_http_message.c @@ -300,6 +300,14 @@ void php_http_message_update_headers(php_http_message_t *msg) zval_ptr_dtor(&h); } } + } else if ((h = php_http_message_header(msg, ZEND_STRL("Content-Length"), 1))) { + zval *h_cpy = php_http_ztyp(IS_LONG, h); + + zval_ptr_dtor(&h); + if (Z_LVAL_P(h_cpy)) { + zend_hash_del(&msg->hdrs, "Content-Length", sizeof("Content-Length")); + } + zval_ptr_dtor(&h_cpy); } }