ASF Bugzilla – Attachment 35258 Details for
Bug 61384
Adding charset to multipart/form-data content type irritates IIS
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Alternative patch taking into account charset only if set
BUG_61384.patch (text/plain), 1.87 KB, created by
Philippe Mouawad
on 2017-08-27 10:17:27 UTC
(
hide
)
Description:
Alternative patch taking into account charset only if set
Filename:
MIME Type:
Creator:
Philippe Mouawad
Created:
2017-08-27 10:17:27 UTC
Size:
1.87 KB
patch
obsolete
>Index: src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java >=================================================================== >--- src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java (revision 1806233) >+++ src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java (working copy) >@@ -1242,7 +1242,7 @@ > if(getUseMultipartForPost()) { > // If a content encoding is specified, we use that as the > // encoding of any parameter values >- Charset charset; >+ Charset charset = null; > if(haveContentEncoding) { > charset = Charset.forName(contentEncoding); > } else { >@@ -1255,6 +1255,9 @@ > } > // Write the request to our own stream > MultipartEntityBuilder multipartEntityBuilder = MultipartEntityBuilder.create(); >+ if(haveContentEncoding) { >+ multipartEntityBuilder.setCharset(charset); >+ } > if(getDoBrowserCompatibleMultipart()) { > multipartEntityBuilder.setLaxMode(); > } else { >@@ -1268,7 +1271,12 @@ > if (arg.isSkippable(parameterName)) { > continue; > } >- StringBody stringBody = new StringBody(arg.getValue(), ContentType.create("text/plain", charset)); >+ StringBody stringBody; >+ if(haveContentEncoding) { >+ stringBody = new StringBody(arg.getValue(), ContentType.create("text/plain", charset)); >+ } else { >+ stringBody = new StringBody(arg.getValue(), ContentType.create("text/plain")); >+ } > FormBodyPart formPart = FormBodyPartBuilder.create( > parameterName, stringBody).build(); > multipartEntityBuilder.addPart(formPart);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 61384
:
35202
| 35258 |
35259