Bug 54119 - HTTP 307 response is not redirected
Summary: HTTP 307 response is not redirected
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: HTTP (show other bugs)
Version: 2.8
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
Depends on:
Reported: 2012-11-08 10:34 UTC by Philippe Mouawad
Modified: 2012-11-08 12:04 UTC (History)
1 user (show)


Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Mouawad 2012-11-08 10:34:32 UTC
I have a request that answers with a  307.
JMeter does not redirect it, testing it with Chrome, Safari, IE8, and Firefox 16.0.2, all browsers do the redirection.

Spec says:
" The requested resource resides temporarily under a different URI. Since the redirection MAY be altered on occasion, the client SHOULD continue to use the Request-URI for future requests. This response is only cacheable if indicated by a Cache-Control or Expires header field.

The temporary URI SHOULD be given by the Location field in the response. Unless the request method was HEAD, the entity of the response SHOULD contain a short hypertext note with a hyperlink to the new URI(s) , since many pre-HTTP/1.1 user agents do not understand the 307 status. Therefore, the note SHOULD contain the information necessary for a user to repeat the original request on the new URI.

If the 307 status code is received in response to a request other than GET or HEAD, the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user, since this might change the conditions under which the request was issued. "
Comment 1 Sebb 2012-11-08 11:27:43 UTC
What redirect mode are you using? Auto? Follow?
Which HTTP sampler types?
Comment 2 Philippe Mouawad 2012-11-08 11:29:59 UTC
Using follow redirect
HTTP Sampler 4.

The issue is related to the following code in HTTPSampleResult:
    public boolean isRedirect() {
        final String[] REDIRECT_CODES = { "301", "302", "303" }; // NOT 304!
        String code = getResponseCode();
        for (int i = 0; i < REDIRECT_CODES.length; i++) {
            if (REDIRECT_CODES[i].equals(code)) {
                return true;
        return false;

I think 307 should be added + a check that it's a HEAD or GET before following redirect
Comment 3 Philippe Mouawad 2012-11-08 12:04:14 UTC
Date: Thu Nov  8 12:02:06 2012
New Revision: 1407026

URL: http://svn.apache.org/viewvc?rev=1407026&view=rev
Bug 54119 - HTTP 307 response is not redirected
Bugzilla Id: 54119


Date: Thu Nov  8 12:03:34 2012
New Revision: 1407028

URL: http://svn.apache.org/viewvc?rev=1407028&view=rev
Bug 54119 - HTTP 307 response is not redirected
Comment 4 The ASF infrastructure team 2022-09-24 20:37:52 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2974