You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a method that gets a route and ensures the response is a redirect. Add an optional string argument that is the expected path of the redirect. You'll probably need to configure the client to not automatically follow redirects.
Note I'm not sure we can perform this check without creating a new instance of HttpClient.
If we need a new instance, it won't really make sense to use an extension method on the existing instance. We could require that the instance we're given have this property set:
AllowAutoRedirect = false;
but there's no public property that shows that information on HttpClient that I see.
We might need to use reflection on the client to see if its handler's MaxRedirects is set to 0 or not.
The text was updated successfully, but these errors were encountered:
Add a method that gets a route and ensures the response is a redirect. Add an optional string argument that is the expected path of the redirect. You'll probably need to configure the client to not automatically follow redirects.
Note I'm not sure we can perform this check without creating a new instance of
HttpClient
.See: https://stackoverflow.com/questions/10453892/how-can-i-get-system-net-http-httpclient-to-not-follow-302-redirects
If we need a new instance, it won't really make sense to use an extension method on the existing instance. We could require that the instance we're given have this property set:
but there's no public property that shows that information on
HttpClient
that I see.We might need to use reflection on the client to see if its handler's MaxRedirects is set to 0 or not.
The text was updated successfully, but these errors were encountered: