Files
Clay Gerrard
4aadb54025
Ensure Content-Length in backend container/account HEAD response
A failing CORS test in the gate discovered that, when running with eventlet==0.38.0, container and account HEAD requests returned Content-Type of application/json to clients regardless of the requested format. This was due to the backend HEAD response no longer having a Content-Length header, causing the listing_formats middleware to not modify the returned Content-Type (see Related-Change). The Related-Change fixed the client facing issue by making listing_formats middleware ensure the correct Content-Type is returned to clients even when Content-Length is absent in the backend response. The Related-Change also ensured that the 204 response to clients always has a Content-Length header. This patch directly fixes the problem of backend account and container server HEADs no longer having 'Content-Length: 0' by adding it explicitly. This violates the RFC prohibition of a 204 response having a Content-Length header [1], but preserves Swift's historic behavior and is consistent with the proxy-server's 204 response to clients. [1] https://httpwg.org/specs/rfc7230.html#header.content-length Related-Change: If724485e1425d1481d10b9255436301e346f07e8 Change-Id: Idacc59c5f43367926eff5221ee7fc417a9bc2d50