Bug 50516 - "Host" header in HTTP Header Manager is not included in generated HTTP request
Summary: "Host" header in HTTP Header Manager is not included in generated HTTP request
Status: RESOLVED FIXED
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: HTTP (show other bugs)
Version: 2.4
Hardware: PC Linux
: P2 major (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-22 21:19 UTC by Mark
Modified: 2011-05-17 19:40 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark 2010-12-22 21:19:35 UTC
No matter what I set "Host" to in HTTP Header Manager, JMeter completely ignores the setting and instead sends the "Server Name or IP" setting from the HTTP Request settings.  This is easily repeatable and a real drag since there's no way for me to test virtual hosts if I can't modify the Host header.

OS is Ubuntu 9.10 with the stock jmeter 2.3.4 packages installed.
Comment 1 Dmitry Khokhlov 2011-05-04 11:46:47 UTC
The same in JMeter 2.4. I need this too to test my virtual hosts.
Comment 2 Dmitry Khokhlov 2011-05-04 11:48:23 UTC
The same in JMeter 2.4. I need this too to test my virtual hosts.
Comment 3 Sebb 2011-05-17 17:17:50 UTC
This is not strictly a JMeter problem; you can add a "Host" entry to the Header Manager and it will be passed to the HTTP implementation.

However, both the Java and Commons HttpClient 3.1 implementations ignore the header, and generate their own Host headers from the request.

It's possible to pass a virtual hostname to HC 3.1 (and with HttpClient 4.x which will be supported in the next release of JMeter), but does not appear to be possible to use virtual hosts with the Java HTTP implementation.
Comment 4 Sebb 2011-05-17 19:31:44 UTC
Fixed for HttpClient 3.1 and HttpComponents HttpClient 4.x.

Not possible to fix this for the Java HTTP implementation.

URL: http://svn.apache.org/viewvc?rev=1104485&view=rev
Log:
Bug 50516 - "Host" header in HTTP Header Manager is not included in generated HTTP request

Modified:
   jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC3Impl.java
   jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
   jakarta/jmeter/trunk/xdocs/changes.xml
Comment 5 The ASF infrastructure team 2022-09-24 20:37:45 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2446