Bug #79575 [Opn->Ver]: Content-Length header name is getting corrupted

From: Date: Sat, 09 May 2020 13:32:50 +0000
Subject: Bug #79575 [Opn->Ver]: Content-Length header name is getting corrupted
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-226971@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=79575&edit=1

 ID:                 79575
 Updated by:         cmb@php.net
 Reported by:        kevin dot seymour at gmail dot com
 Summary:            Content-Length header name is getting corrupted
-Status:             Open
+Status:             Verified
 Type:               Bug
-Package:            *Compression related
+Package:            OpenSSL related
-Operating System:   RHEL
+Operating System:   *
-PHP Version:        7.2.30
+PHP Version:        7.3
 Block user comment: N
 Private report:     N

 New Comment:

Apparently, the respective SSL_read() call[1] yields the broken
contents. 

[1] <https://github.com/php/php-src/blob/php-7.3.17/ext/openssl/xp_ssl.c#L2099>


Previous Comments:
------------------------------------------------------------------------
[2020-05-08 16:59:35] kevin dot seymour at gmail dot com

Description:
------------
When you run the below script you'll see the Content-Length header will come back with the
correct value, but that the word Content is jumbled.  For example:

Cteonnt-Length: 195628.

If you change Accept-Encoding to identity (disable compression) the value comes back correctly. 
This is causing unexpected end of data errors when we use SoapClient to attempt to parse a WSDL as
only part of the XML is returned.

There is a lot of testing information here:

https://stackoverflow.com/questions/61681804/php-file-get-contents-returning-inconsistent-partial-data-for-http-requests

Test script:
---------------
php << 'EOF'
<?php
$ctx = stream_context_create(array(
    'http' => array(
        'header' => "Accept-Encoding: gzip"
     )
));
$xml = file_get_contents('https://webservices3.autotask.net/atservices/1.6/atws.wsdl',
false, $ctx);
echo var_dump($http_response_header);
?>
EOF

Expected result:
----------------
Content-Length should remain with the same header name.

Actual result:
--------------
Content-Length header field name is corrupted.


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=79575&edit=1


Thread (5 messages)

« previous php.bugs (#226971) next »