Bug 52781 - Content-Disposition header garbled even if browser compatible headers is checked (HC4)
Content-Disposition header garbled even if browser compatible headers is chec...
Status: RESOLVED FIXED
Product: JMeter
Classification: Unclassified
Component: HTTP
2.6
All All
: P2 normal (vote)
: ---
Assigned To: JMeter issues mailing list
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2012-02-28 06:24 UTC by Tetsuya Takatsuru
Modified: 2012-02-28 12:37 UTC (History)
1 user (show)



Attachments
patch on HTTPHC4Impl (919 bytes, patch)
2012-02-28 06:27 UTC, Tetsuya Takatsuru
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tetsuya Takatsuru 2012-02-28 06:24:56 UTC
Some browsers (IE, FF, Opera, etc...) uses raw filename for "filename" parameter of Content-Disposition header in the part of multipart post request.

for example:

-----(bounary)-----
Content-Disposition: form-data; name="uploadFile"; filename="私の添付ファイル.txt"
Content-Type: text/plain

... (content of file)
-----(bounary)-----

Now, the filename is changed to "????????.txt" regardless of "browser compatible headers" option:

-----(bounary)-----
Content-Disposition: form-data; name="uploadFile"; filename="????????.txt"
Content-Type: text/plain

... (content of file)
-----(bounary)-----

However, HTTPHC4Impl is expected to send request the same as browsers when "browser compatible mode" is checked.

Charset is needed for constructor of MultipartEntity so that browser compatible mode works correctly.
Here is a patch fixing it.
Comment 1 Tetsuya Takatsuru 2012-02-28 06:27:44 UTC
Created attachment 28394 [details]
patch on HTTPHC4Impl
Comment 2 Philippe Mouawad 2012-02-28 12:06:55 UTC
Applied partly with fix when content encoding is empty or null.
Also fixed Test Case TestHTTPSamplersAgainstHttpMirrorServer that computed wrong boundary


Date: Tue Feb 28 10:03:45 2012
New Revision: 1294541

URL: http://svn.apache.org/viewvc?rev=1294541&view=rev
Log:
Bug 52781 - Content-Disposition header garbled even if browser compatible headers is checked (HC4)

Modified:
   jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java

Date: Tue Feb 28 12:03:41 2012
New Revision: 1294596

URL: http://svn.apache.org/viewvc?rev=1294596&view=rev
Log:
Bug 52781 - Content-Disposition header garbled even if browser compatible headers is checked (HC4)
Handle correctly null contentEncoding

Modified:
   jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java


Date: Tue Feb 28 12:05:02 2012
New Revision: 1294598

URL: http://svn.apache.org/viewvc?rev=1294598&view=rev
Log:
Bug 52781 - Content-Disposition header garbled even if browser compatible headers is checked (HC4)
Fixed wrong Boundary extraction

Modified:
   jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/TestHTTPSamplersAgainstHttpMirrorServer.java
Comment 3 Philippe Mouawad 2012-02-28 12:37:33 UTC
Thanks for patch and clear submission.