-
Notifications
You must be signed in to change notification settings - Fork 38.9k
Open
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancementA general enhancement
Milestone
Description
ServletServerHttpRequest#getHeaders re-creates the MediaType if ServletRequest#getCharacterEncoding is not null but the request "Content-Type" doesn't have a charset parameter. This is quite common in practice because the former is always true while the latter is common and fully expected, e.g. for "application/json".
We can update methods in ServletRequestHeadersAdapter that access header values (getFirst, get) to add special handling for "Content-Type", appending the charset lazily, and caching the result, also ensuring UTF-8 is not appended to "application/json".
That would allow us to drop the code that re-creates the MediaType, that in turn also triggers the RequestHeaderOverrideWrapper to create an override map.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancementA general enhancement