Skip to content

Document that the exact behavior of the maximum HTTP request header size property is server-specific #40798

@StuAtGit

Description

@StuAtGit

Summary: max-http-header-size appears to cap requests based on the length of the request-line, which is not part of the header block.

Details:

Actual Behaviour
We were making GET requests, and received 400/Bad Request once the URL got past a certain length. Raising the max-http-header-size allowed the request to go through.

However, the URL is not part of the http header block, it is part of the http request line, so it took a bit of wild guessing and trial and error to identify this fix.

I can dig up the RFCs if needed, but a clear explanation of what constitutes a HTTP header block can be found in MDNs coverage of HTTP Basics:

https://developer.mozilla.org/en-US/docs/Web/HTTP/Messages

When debugging problems with URLs being rejected because of length, it would be easier to address issues if the config names weren't misleading.

To more precisely define "misleading"

-> Configs that used terms from the HTTP protocol (in the context of an http configuration) did not use them in the same way that they are defined in the protocol. Particularly for basic, elemental parts of the HTTP protocol.

Expected behaviour:

In a perfect world, it would be nice if:

max-http-[request]-header-size limited the the size of the headers the service accepted, with a clear http status message to that effect.

max-http-request-line-size limited the size of the request-line, with a clear http status message to that effect.

In a not-so-perfect-world, it would be nice if:
If spring decides to use basic, common, well-defined terms in ways that are in variance with the well-defined meaning, it would be good to, at least, define that variance explicitly.

I realize you folks may just be translating this into the underlying (Jetty/Undertow/Netty) configurations, so there may be limited flexibility here, but, at very least, documenting the "SURPRISE! WE mean something entirely different than what the word is defined to mean!" bits, so the poor users slogging through debugging and fixing these issues have some help, would be greatly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions