cloudfoundry / gorouter

CF Router
Apache License 2.0
441 stars 224 forks source link

Fix metric counting incorrect `Content-Length` headers #417

Closed peanball closed 4 months ago

peanball commented 4 months ago

Summary

Go 1.22 introduced stricter checks for Content-Length headers. The header, if set, must not be empty.

This new strict check can be worked around with debug.httplaxcontentlength, which will allow empty Content-Length headers. In preparation for users disabling this debug flag that Gorouter turns on by default, a metric is emitted to collect requests that would break when the workaround is disabled.

The metric introduced in https://github.com/cloudfoundry/gorouter/pull/412 was erroneous, see https://github.com/cloudfoundry/routing-release/issues/411.

Backward Compatibility

Breaking Change? Yes(ish)

The metric that was recently introduced, called missing_content_length_header is misleadingly named and renamed in this PR to empty_content_length_header instead.

peanball commented 4 months ago

@mariash, @MarcPaquette, maybe you can have a look as well.