Restore isPositive check for maxHttpHeaderSize #14986
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
server.max-http-header-sizewas 0, but that has regressed in 2.1.0.RC1 and now the max is set to 0 when configured as 0In Bitbucket Server, we've added some code around Spring Boot which facilitates adding multiple HTTP connectors, a common necessity when standing up a load balancer or reverse proxy in front of the system. The properties we support for those additional connectors are drawn from, and configured similarly to, how Spring Boot handles the primary connector.
As we build out Java 11 support, we've upgraded to Spring Boot 2.0.6 without any significant changes (aside from "standard" Spring Boot 1.5 -> 2.0 migration steps). Upgrading to 2.1.0.RC1, however, resulted in all HTTP processing failing with this error:
I tracked this down to the introduction of
DataSizeand the way theTomcatWebServerFactoryCustomizerapplies themaxHttpHeaderSize. In 2.0.x, the chain included awhen(this::isPositive)that is no longer present. I don't see anything about this change in behavior in the various 2.1.0.M1-RC1 documentation, which makes me feel like it's a regression rather than a conscious change.In case you're curious why we're using 0, it's to allow this in our default properties:
This way, when multiple connectors are present, it's possible to apply a consistent
max-http-header-sizeto all of them by adjusting the primary connector (and still possible to selectively override for additional connectors if necessary).