-
Notifications
You must be signed in to change notification settings - Fork 95
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
Add functor to deal with redirect #85
Comments
I propose putting it in error.h
|
For some reason I still can't actually catch the exception, I just get SIGABRT. |
This is an internal exception where the client either retries the request with the redirect-url or gives up, based on the redirect settings. At the time the server requests a redirect, the client have built up state for the request, and it tries to re-use as much state as possible for the redirected request. Aborting the request and then building a new one would, under normal circumstances, waste resources. However, if you want to filter or inspect the redirect request before it's executed (or rejected), a predicate functor could accomplish that. So what I need to know is what your target is? What do you want to do when the server sends a redirect request? |
I would like to catch the redirect myself and figure out if I want to continue through the redirection or not. But I would also like to read the Location of the redirect and any other header information. |
I have added a callback that can look at redirects in "staging" branch. I'll have to write some tests and document it before I can release it in the master branch. The callback can be set in the Properties, and you can inspect and modify the redirect url. You can throw an exception to abort the redirect. You also have access to the server-reply with all the headers. |
We can call SendRequest and GetReply, but we cannot use the RedirectException, because its not in the header, its in the Implementation .cpp file. It should be in the header so we can handle the exception and get the data. @jgaa
The text was updated successfully, but these errors were encountered: