Bug 60579 - Since JMeter 3.1 HTTP request sampler adds unnecessary Content-Type header into GET requests without body
Summary: Since JMeter 3.1 HTTP request sampler adds unnecessary Content-Type header in...
Status: RESOLVED DUPLICATE of bug 60575
Alias: None
Product: JMeter
Classification: Unclassified
Component: HTTP (show other bugs)
Version: 3.1
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-12 13:23 UTC by lpetr
Modified: 2017-01-12 14:26 UTC (History)
0 users



Attachments
Test plan used to reproduce the issue (4.77 KB, application/xml)
2017-01-12 13:23 UTC, lpetr
Details

Note You need to log in before you can comment on or make changes to this bug.
Description lpetr 2017-01-12 13:23:14 UTC
Created attachment 34615 [details]
Test plan used to reproduce the issue

Hello,

I found since JMeter 3.1 "HTTP request" sampler adds unnecessary "Content-Type: text/plain; charset=ISO-8859-1" header into GET requests with no data in body.

RFC2616 section 7.2.1 says:
"Any HTTP/1.1 message containing an entity-body SHOULD include a Content-Type header field defining the media type of that body. If and only if the media type is not given by a Content-Type field, the recipient MAY attempt to guess the media type via inspection of its content and/or the name extension(s) of the URI used to identify the resource. If the media type remains unknown, the recipient SHOULD treat it as type "application/octet-stream"."

If my understanding is correct, the header should not be present for simple GET requests without "entity-body".


JMeter 3.1 behavior:
GET http://www.google.com/

GET data:
[no cookies]

Request Headers:
Connection: keep-alive
Content-Length: 0
Content-Type: text/plain; charset=ISO-8859-1
Host: www.google.com
User-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_111)




JMeter 3.0 behavior (correct/expected):
GET http://www.google.com/

GET data:
[no cookies]

Request Headers:
Connection: keep-alive
Content-Length: 0
Host: www.google.com
User-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_111)
Comment 1 Felix Schumacher 2017-01-12 14:26:40 UTC
Looks like the same bug in the end.

*** This bug has been marked as a duplicate of bug 60575 ***