Skip to content
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

Issues with mod_cfml on first request #7

Open
dswitzer opened this issue Mar 18, 2022 · 2 comments
Open

Issues with mod_cfml on first request #7

dswitzer opened this issue Mar 18, 2022 · 2 comments

Comments

@dswitzer
Copy link
Contributor

We've noticed a problem with bolthttp when a request is made to a server running mod_cfml to create dynamic Tomcat contexts.

The issue is that mod_cfml will issue a redirect (hopefully a 307) to force the client to retry to request.

You can work around this by enabling redirects on a request, but in our case we explicitly are not following redirects because a 301 or 302 is a sign of a problem.

It would appear this issue can be solved in Apache HttpClient by implementing a redirect strategy. I'm wondering if it would make sense to add support for configuring BoltHTTP to only follow specific redirect commands or at least potentially always honor a 307 redirect, since this seems to be specifically for these kinds of operations (where an HTTP request must be retried).

@pfreitag
Copy link
Member

I think it would probably be best left to the application code to handle the retry, as I don't think it would be clear to the developer if it redirected automatically on certain status codes and not for others. There are cases where I write code that I don't want to redirect in any circumstance like you are.

If something was builtin to bolt, and it was done with an option that was off by default I'd be ok with that approach.

@dswitzer
Copy link
Contributor Author

A potential approach to solving this issue would be to refactor the redirect configuration option to accept the following:

Value Description
true Enabled redirects
false Disable redirects
List of HTTP status code Only redirect on the specific status codes.

So if a list is supplied, we'd trigger a custom redirect strategy that would only redirect on those specific status codes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants