Skip to content
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

[2678] Send multiple headers for url-encoded and multipart-form bodies #2679

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ilia1243
Copy link

@ilia1243 ilia1243 commented Nov 11, 2024

Motivation:

Multiple headers are not sent with url-encoded and multipart-form bodies.

Solution:

Change resolution of headers in HttpContext#handleCreateRequest(). Do not use MultiMap#get() to copy headers anymore. Instead, copy the entries from the original MultiMap using MultiMap#addAll(MultiMap).

Fixes #2678

Comment on lines +448 to +451
for (String headerName : requestHeaders.names()) {
headers.remove(headerName);
}
headers.addAll(requestHeaders);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I do not quite understand why headers are copied twice. See

)

Without the second copying all tests are also passed. Check test commit ilia1243@f470308

Though I see some activity with this code

  1. 8c482962
  2. 4ea2fb35

I did not remove this part, because do not see the whole picture. Please comment if this can be removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Only one header value of several is sent with MultipartForm body
1 participant