-
Notifications
You must be signed in to change notification settings - Fork 798
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plugins and non-zero number_of_redirections #11676
Comments
Yes, it will follow it. Here's a quick way to reproduce. AuTest SetupApply the following patch to the header_rewrite_url_glob AuTest: diff --git a/tests/gold_tests/pluginTest/header_rewrite/header_rewrite_url_glob.test.py b/tests/gold_tests/pluginTest/header_rewrite/header_rewrite_url_glob.test.py
index 006acaabb..02816f033 100644
--- a/tests/gold_tests/pluginTest/header_rewrite/header_rewrite_url_glob.test.py
+++ b/tests/gold_tests/pluginTest/header_rewrite/header_rewrite_url_glob.test.py
@@ -35,9 +35,10 @@ server.addResponse("sessionfile.log", request_header, response_header)
ts.Disk.records_config.update(
{
'proxy.config.url_remap.remap_required': 0,
+ 'proxy.config.http.number_of_redirections': 1,
'proxy.config.diags.debug.enabled': 1,
'proxy.config.diags.show_location': 0,
- 'proxy.config.diags.debug.tags': 'header',
+ 'proxy.config.diags.debug.tags': 'header|http|redirect',
})
ts.Setup.CopyAs('rules/glob_set_redirect.conf', Test.RunDirectory)
And make the following modification to the debug tags: Log ObservationThe AuTest passes and it's not obvious that a redirect happened without examining traffic.out. The first relevant part of traffic.out is the initial response handling, where the redirect gets initiated. Note
The second relevant part of traffic.out is the DNS Lookup for the URI in the
This gets another 301 response and sends it back to the client because the maximum number of redirects (1) has been reached. The response is what the AuTest expects, so it passes. |
When I added that test I rashly assumed that redirect.com was an invalid domain name. |
Looks like that's one of the tests that needs to make a dummy DNS server with the Au test extension. |
If a plugin (header_rewrite for example) sets the reply status to 301, and proxy.config.http.number_of_redirections is non-zero, will it follow the redirect (and should it)?
The text was updated successfully, but these errors were encountered: