Bug 42022 - HTTPSampler does not allow multiple headers of same name
HTTPSampler does not allow multiple headers of same name
Status: RESOLVED FIXED
Product: JMeter
Classification: Unclassified
Component: HTTP
2.2
PC Linux
: P3 normal (vote)
: ---
Assigned To: JMeter issues mailing list
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2007-04-02 09:49 UTC by Michael Matthews
Modified: 2007-04-03 12:59 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Matthews 2007-04-02 09:49:56 UTC
I'm trying to set up a test that sends multiple headers of the same name to a website.  If I add one HTTP 
Header Manager config element with multiple headers, or multiple HTTP Header Manager config 
elements each with one header, jmeter uses the last configured header as the only one in the actual 
request.

For example, with a header manager configuration as follows (cut 'n paste from xml file):

        <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname
="Multiple X-F-F headers" enabled="true">
          <collectionProp name="HeaderManager.headers">
            <elementProp name="" elementType="Header">
              <stringProp name="Header.value">192.168.1.1</stringProp>
              <stringProp name="Header.name">X-Forwarded-For</stringProp>
            </elementProp>
            <elementProp name="" elementType="Header">
              <stringProp name="Header.value">192.168.1.2</stringProp>
              <stringProp name="Header.name">X-Forwarded-For</stringProp>
            </elementProp>
          </collectionProp>
        </HeaderManager>
        <hashTree/>
        <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname
="More X-F-F" enabled="true">
          <collectionProp name="HeaderManager.headers">
            <elementProp name="" elementType="Header">
              <stringProp name="Header.value">192.168.1.3</stringProp>
              <stringProp name="Header.name">X-Forwarded-For</stringProp>
            </elementProp>
          </collectionProp>
        </HeaderManager>
Comment 1 Sebb 2007-04-02 16:51:08 UTC
Thanks for the report.

Found the problem - HTTPSampler was using setRequestProperty instead of 
addRequestProperty, so only one of each header was saved. Also the values were 
not being set up correctly for the TreeView request pane.

The code has been fixed in SVN and will appear in nightlies after r524971.

The HTTPClient Sampler was not affected.
Comment 2 Michael Matthews 2007-04-03 12:06:46 UTC
Thanks for the fix and suggestions, appreciate the fast turnaround.

Mike
Comment 3 Sebb 2007-04-03 12:59:25 UTC
No problem; it was fairly simple to fix which helps to speed things up!

By the way, the currently nightly r525254 (or any later ones) will include the 
fix.