The current behavior of azuretls-client's redirect following does not preserve the request scope OrderedHeaders of the original request. To persist headers across redirections, one has to use the session scope OrderedHeaders, which is not ideal in some circumstances (For example, I am setting the Cookie headers and I don't use azuretls's built in cookie jar by always setting req.NoCookie flag).
I suggest adding a new CheckRedirect hook, similar to go standard http client's CheckRedirect. It will allow user gain more control of the redirection, like setting headers or other parameters of the new request, or even prevent the redirection. it may looks like:
The current behavior of azuretls-client's redirect following does not preserve the request scope OrderedHeaders of the original request. To persist headers across redirections, one has to use the session scope OrderedHeaders, which is not ideal in some circumstances (For example, I am setting the Cookie headers and I don't use azuretls's built in cookie jar by always setting req.NoCookie flag).
I suggest adding a new CheckRedirect hook, similar to go standard http client's CheckRedirect. It will allow user gain more control of the redirection, like setting headers or other parameters of the new request, or even prevent the redirection. it may looks like:
It could be a session scope or request scope hook, or both.