Comment 7 for bug 1568650

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to swift (master)

Reviewed: https://review.openstack.org/575876
Committed: https://git.openstack.org/cgit/openstack/swift/commit/?id=4a0afa9fea60bf2d1943b59a1f4ab49cb89e682a
Submitter: Zuul
Branch: master

commit 4a0afa9fea60bf2d1943b59a1f4ab49cb89e682a
Author: Samuel Merritt <email address hidden>
Date: Fri Jun 15 16:31:25 2018 -0700

    Enforce Content-Length in catch_errors

    If a WSGI application produces the header "Content-Length: <N>" but
    does not produce exactly N bytes of response, then that is an error
    and an exception should be thrown so that the WSGI server can take the
    correct action (close the TCP connection for HTTP <= 1.1, something
    else for HTTP 2.0).

    As part of this, I also fixed a bug in DLOs where a HEAD response
    might have a body. The way it works is this:

     * user makes HEAD request for DLO manifest

     * DLO middleware makes GET request for container

     * authorize callback (e.g. from tempurl) replies 401 for container
       GET; response has a nonempty body (it's a GET response; that's
       fine)

     * DLO notes that response is non-2xx, returns it as-is

     * client gets response with nonempty body to a HEAD request

    The fix there was simple; if the original request method was HEAD,
    clear out the response body.

    Change-Id: I74d8c13eba2a4917b5a116875b51a781b33a7abf
    Related-Bug: 1568650