Am 18.08.2017 um 15:27 schrieb Arif Waram:
Hapi.js is running standalone.

OK, I'll try out the patch you sent, Thank you so much.


ps. Always adding charset for any multi-part request in version 3.2, is that by 
design?

can we make it to the optional part in the next update?
I have just submitted the patch, so it should be in the next nightly. I am still interested in your feedback.

Felix


________________________________
From: Felix Schumacher <[email protected]>
Sent: Thursday, August 17, 2017 22:20
To: [email protected]
Subject: Re: Multi-part missing boundary problem, while upload an image type in 
JMeter 3.2

Am 17.08.2017 um 10:55 schrieb Arif Waram:
Hi,

I have some issue with JMeter 3.2 r 1790748. When I create an HTTP Request to 
POST image file to the server with these options.


[/] Use multipath/form-data for POST

[/] Browser-compatible headers.

[/] Client implementation: HttpClient4 (Java and none are also give the same 
result).

Server side use Hapi.js to handle HTTP Request.

But It occurs "400 (Bad request): Invalid content-type header: multipart missing 
boundary" message.


but when I try with JMeter 2.13 r 1665067 with all same settings, everything works fine 
with "200 OK" message.


I guess that it because in JMeter 3.2 it always adds "charset = US-ASCII" after boundary value in 
Content-Type field (but JMeter 2.13 didn't). In my case, media type is an "image", not a 
"text" subtype. so I'm not sure that is it necessary to specify charset according to RFC2616.
You might want to look at (add your case to)

https://bz.apache.org/bugzilla/show_bug.cgi?id=61384
61384 – Adding charset to multipart/form-data content type 
...<https://bz.apache.org/bugzilla/show_bug.cgi?id=61384>
bz.apache.org
Created attachment 35202 Don't add charset to multipart/form-data content type 
As reported by a few JMeter users on the users mailing list. IIS will not 
accept files ...




Or the other bug entries that Philippe has mentioned there.

Is hapi.js running standalone or behind an iis?

It would be awesome, if you can try out the attached patch.

Regards,
   Felix

Here are HTTP Requests from both version.

http://www.ietf.org/rfc/rfc2046.txt
RFC 2046 - Internet Engineering Task Force<http://www.ietf.org/rfc/rfc2046.txt>
www.ietf.org
Network Working Group N. Freed Request for Comments: 2046 Innosoft Obsoletes: 
1521, 1522 ...




1.) JMeter 3.2 r 1790748

POST http://mydomain.com:8085/addImage


POST data:

--KwRk__3noM4jyn3FWmoKp1FJiXeDniWoY2QF22

Content-Disposition: form-data; name="image"; filename="trump.jpg"

Content-Type: image/jpeg


<actual file content, not shown here>

--KwRk__3noM4jyn3FWmoKp1FJiXeDniWoY2QF22--


[no cookies]


Request Headers:

Connection: keep-alive

Content-Length: 21689

Content-Type: multipart/form-data; 
boundary=KwRk__3noM4jyn3FWmoKp1FJiXeDniWoY2QF22; charset=US-ASCII

Host: mydomain.com:8085

User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_121)



2.)  JMeter 2.13 r 1665067

POST http://mydomain.com:8085/addImage


POST data:

--R6N4_OKH-BGdZFZoPrkOlw9ntsrstTe

Content-Disposition: form-data; name="image"; filename="trump.jpg"

Content-Type: image/jpeg


<actual file content, not shown here>

--R6N4_OKH-BGdZFZoPrkOlw9ntsrstTe--


[no cookies]


Request Headers:

Connection: keep-alive

Content-Length: 21675

Content-Type: multipart/form-data; boundary=R6N4_OKH-BGdZFZoPrkOlw9ntsrstTe

Host: mydomain.com:8085
User-Agent: Apache-HttpClient/4.2.6 (java 1.5)


Best regards.
Arif



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to