Skip to content

Polish HttpRequestValues #34914

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,9 @@ public Builder setContentType(MediaType contentType) {
* Add the given header name and values.
*/
public Builder addHeader(String headerName, String... headerValues) {
HttpHeaders headers = initHeaders();
for (String headerValue : headerValues) {
initHeaders().add(headerName, headerValue);
headers.add(headerName, headerValue);
}
return this;
}
Expand All @@ -373,8 +374,9 @@ private HttpHeaders initHeaders() {
* Add the given cookie name and values.
*/
public Builder addCookie(String name, String... values) {
MultiValueMap<String, String> cookies = initCookies();
for (String value : values) {
initCookies().add(name, value);
cookies.add(name, value);
}
return this;
}
Expand Down Expand Up @@ -402,8 +404,9 @@ private MultiValueMap<String, String> initCookies() {
* parameters.
*/
public Builder addRequestParameter(String name, String... values) {
MultiValueMap<String, String> requestParams = initRequestParams();
for (String value : values) {
initRequestParams().add(name, value);
requestParams.add(name, value);
}
return this;
}
Expand Down