-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
HttpClient redirect bug #21446
Comments
What's the question? You asked the same question on stackoverflow and got this answer: |
No, this is not question. Why HttpClient don't redirect on specific url? I think HttpClient should redirect on any pages which have Location header. |
How to disable this behavior? Have we some options for it? Security is unimportant thing in my problem. |
If you need to handle HTTPS -> HTTP redirection, you should disable automatic redirection in HttpClient. Then handle the 3xx responses yourself. var handler = new HttpClientHandler();
handler.AllowAutomaticRedirect = false;
var client = new HttpClient(handler); |
Wow. Why we can't add the flag "enable redirect https -> http"? |
We could. Is it worth it? The workaround above is reasonable. |
Closing as by-design. If you would like to raise this as a new design issue/discussion, please contribute to https://github.com/dotnet/designs/issues/9 |
http://stackoverflow.com/questions/43573321/httpclient-302-redirect
I have 2 urls: https://pcr.apple.com/id868222886 and https://jigsaw.w3.org/HTTP/300/302.html. Both have a location link and 302 response code. But apple's link has 0-len response body.
The text was updated successfully, but these errors were encountered: