Skip to content
This repository was archived by the owner on Jan 30, 2020. It is now read-only.
This repository was archived by the owner on Jan 30, 2020. It is now read-only.

Response class blindly attempts to inflate empty body #76

Closed
@GeeH

Description

@GeeH

This issue has been moved from the zendframework repository as part of the bug migration program as outlined here - http://framework.zend.com/blog/2016-04-11-issue-closures.html


Original Issue: https://api.github.com/repos/zendframework/zendframework/issues/7220
User: @miguelsimoes
Created On: 2015-02-14T16:44:51Z
Updated At: 2015-11-06T20:31:08Z
Body
Looking at the code:

    ErrorHandler::start();
    $return = gzinflate(substr($body, 10));
    $test = ErrorHandler::stop();
    if ($test) {
        throw new Exception\RuntimeException(
            'Error occurred during gzip inflation',
            0,
            $test
        );
    }

That exists in the decodeGzip method under the \Zend\HttpResponse FQCN, this breaks when you get a Content-Encoding: gzip header with empty body. The Response class should verify the Content-Length associated with the response before blindly attempt to call the decodeGzip method.


Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions