Bug 50516 - "Host" header in HTTP Header Manager is not included in generated HTTP request
"Host" header in HTTP Header Manager is not included in generated HTTP request
Status: RESOLVED FIXED
Product: JMeter
Classification: Unclassified
Component: HTTP
2.4
PC Linux
: P2 major (vote)
: ---
Assigned To: JMeter issues mailing list
:
Depends on:
Blocks:
  Show dependency tree
 
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