Bug 65328 - HTTP 308 Permanent Redirect is not supported
Summary: HTTP 308 Permanent Redirect is not supported
Status: RESOLVED FIXED
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: HTTP (show other bugs)
Version: 5.4.1
Hardware: All All
: P2 normal (vote)
Target Milestone: JMETER_5.5
Assignee: JMeter issues mailing list
URL: https://github.com/apache/jmeter/pull...
Keywords: FixedInTrunk
Depends on:
Blocks:
 
Reported: 2021-05-24 19:28 UTC by bgaillard
Modified: 2021-05-26 18:44 UTC (History)
0 users



Attachments
Shows the buggy behavior in the View Results Tree when a 308 response is received. (66.51 KB, image/png)
2021-05-24 19:28 UTC, bgaillard
Details
Show the View Results Tree which should be displayed after fix is applied. (82.04 KB, image/png)
2021-05-24 19:30 UTC, bgaillard
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bgaillard 2021-05-24 19:28:54 UTC
Created attachment 37876 [details]
Shows the buggy behavior in the View Results Tree when a 308 response is received.

Hi, I encountered a problem testing our website which is returning HTTP 308 Permanent Redirect status code.

When I create a request returning this kind of response and having the "Follow Redirects" option enabled the first request is executed and receives the 308 response. 

But, the successive one is incorrect, it returns a 200 OK response but in the "Sampler result" tab Data type is '("text"|"bin"|""):' instead of '("text"|"bin"|""):text' and the "Response data" tab is empty.

See also the bad-result-tree.png file attached to this case. You'll see that the tree is "flat" (i.e it has 2 "Home" entries) unless it should contain a "Home" root and 2 leaves "Home-0" (for the 308 request) and "Home-1" (for the 200 request).

The good-result-tree.png file shows what should be displayed when execution is not "buggy".

I fixed the problem and will provide a patch just after writing this issue. The fix seems very easy, it just appears that JMeter does not have any support for HTTP 308 redirects.

Thanks for this great tool.

Sincerely,

Baptiste Gaillard
Comment 1 bgaillard 2021-05-24 19:30:17 UTC
Created attachment 37877 [details]
Show the View Results Tree which should be displayed after fix is applied.
Comment 2 bgaillard 2021-05-24 19:54:28 UTC
See Pull Request which fixes the problem here : https://github.com/apache/jmeter/pull/666
Comment 3 Felix Schumacher 2021-05-25 18:58:23 UTC
Thanks for the patch. Can you test next nightly or build from trunk?

commit fe04aff269f32a6d11a50f0c881765251e457dd7
AuthorDate: Tue May 25 20:28:41 2021 +0200

    HTTP 308 Permanent Redirect is not supported
    
    Contributed by Baptiste Gaillard (baptiste.gaillard at gmail.com)
    
    Bugzilla Id: 65328
    Closes #666
---
 .../protocol/http/sampler/HTTPSampleResult.java    | 12 ++-
 .../protocol/http/util/HTTPConstantsInterface.java |  1 +
 .../protocol/http/sampler/TestRedirects.java       | 88 ++++++++++++++++++++++
 xdocs/changes.xml                                  |  3 +
 4 files changed, 102 insertions(+), 2 deletions(-)
Comment 4 bgaillard 2021-05-25 19:10:49 UTC
Thanks for the merge.

I used JMeter based on my PR today a lot while executing several test plans and did not encounter any problem. So looks promising for now.

I'll test it through the nighlty build tomorrow to confirm it works correctly.
Comment 5 bgaillard 2021-05-26 11:33:39 UTC
Hi, I just executed a test plan with HTTP 308 redirections using the last commit on the master branch of the Gitub repository and can confirm it works correctly.
Comment 6 The ASF infrastructure team 2022-09-24 20:38:22 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/5543