https://issues.apache.org/bugzilla/show_bug.cgi?id=51238

             Bug #: 51238
           Summary: Allow overriding Host and other restricted headers
           Product: JMeter
           Version: 2.4
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: HTTP
        AssignedTo: [email protected]
        ReportedBy: [email protected]
    Classification: Unclassified


Currently the if you add the "Host" header to the "HTTP Header Manager", it
gets silently dropped by the underlying java HTTP stack, because this is
considered one of the restricted headers. However, the behavior can be changed
by simply setting the system property named
"sun.net.http.allowRestrictedHeaders" to "true". I have verified that by
passing -Dsun.net.http.allowRestrictedHeaders=true argument on the
command-line, the "Host" header does indeed work.

Since this header is essential in testing the virtualhost functionality
(without having to resort to editing hosts file on each of the load m/c, or
depending on the network configuration), I request that JMeter set this
property by default during the startup and allow overriding the Host header.
Some research is required on what other restricted headers exist and what the
consequence might be, but since we are in the business of testing HTTP, I can't
imagine any harm of allowing any and all.

The workaround of passing this property on the command-line is not very
flexible since it would involve changing any existing scripts that auto-start
jmeter. I have looked at an alternative to programmatically change this
property during the test run by calling __setProperty() in the context of a
user defined variable, but that didn't help. If there is another location where
changing this property could get it working, it could be considered an adequate
workaround, and should be documented.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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

Reply via email to