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

When using httpclient4 implement to upload files, the content-type parameter cannot be set correctly. #5538

Closed
asfimport opened this issue May 17, 2021 · 2 comments

Comments

@asfimport
Copy link
Collaborator

zooltech (Bug 65310):
There is a default content-type parameter in HTTP Manager coomponent.

The upload sampler(Http Request):
In the request header sent by java implement, the value of content-type is correct.
In the request header sent by httpclient4 implement, the value of content-type is the default value defined by HTTP Manager, not the correct value.

See the attachment for details.

Created attachment pic.png: pic

pic

Severity: major
OS: Linux

@asfimport
Copy link
Collaborator Author

@FSchumacher (migrated from Bugzilla):
@zooltech, could you test the next nightly or build from trunk and report back, whether it fixes this issue?

commit 7ac71f1
Author: Felix Schumacher <felix.schumacher@internetallee.de>
AuthorDate: Sun May 30 13:58:33 2021 +0200

Don't let users override content-type header when using multipart/form-data

The content-type header will contain the boundary from the multiparts. That
value can't be guessed by the user and using the original given content-type
will very likely be wrong.

Apart from that reason, the Java implementation of HTTPSampler will use
the generated content-type anyway and therefore this patch will make the
two implementations behave consistently.

https://github.com/apache/jmeter/issues/5538

.../jmeter/protocol/http/sampler/HTTPHC4Impl.java | 6 ++++++
.../jmeter/protocol/http/sampler/TestHTTPHC4Impl.java | 17 +++++++++++++++++
xdocs/changes.xml | 2 ++
3 files changed, 25 insertions(+)

@asfimport
Copy link
Collaborator Author

@FSchumacher (migrated from Bugzilla):
Closed, as no feedback probably means, it works.

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

No branches or pull requests

1 participant