Skip to content

Resolve "Gracefully handle missing Content-Length Header from API"

What does this MR do?

This MR resolves #1078 (closed). It ensures that Gitlab Pages does not include a Content-Length header if it did not receive one from the API.

By default, go's http client will handle a missing Content-Length header by using -1 as the value. If we pass this on to the client, we're actually using a value that's invalid as per the HTTP spec (see the issue for details)

This MR introduces a check whether or not the Content-Length value is valid, and only if this is true, adds a Content-Length header to its own response.

TODO

Closes #1078 (closed)

Edited by Janis Altherr

Merge request reports

Loading