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 that was recently introduced, called missing_content_length_header is misleadingly named and renamed in this PR to empty_content_length_header instead.
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 emptyContent-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 toempty_content_length_header
instead.