Skip to content

In contrast to the Javadoc, ServerHttpRequest.Builder implementation does not override headers #23333

@juanmbellini

Description

@juanmbellini

Javadoc of ServerHttpRequest.Builder clearly says:

which is part of the header(String, String) method (signature can be seen below).

/**
 * Set or override the specified header.
 */
Builder header(String key, String value);

but the default implementation (DefaultServerHttpRequestBuilder) uses an instance of HttpHeaders, which internally uses a MultiValueMap<String, String> to store headers. So, calling the said method does not override the header, but adds it in the MultiValueMap.

Check the following links:

final MultiValueMap<String, String> headers;

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions