Comments (3)
Flurl needs to disable redirects on the HttpClientHandler in order to implement its own redirects features, and that's impossible to do after the HttpClient has been created. So not a bug, but you're right that it could be documented better.
from flurl.
Alright, maybe apart from the documentation side, one could throw an error or warn if it is unsupported? (or sort it out via custom typing, so that these Extension Methods are not callable if configured with a custom HttpClient)
Another thing to note is, that this breaks functionality for a use case that needs to ignore SSL Certificates, but also needs the Redirect Features.
Should I make a PR to the https://github.com/tmenier/flurl-site/ Repository with remarks on incompatibility?
from flurl.
one could throw an error or warn if it is unsupported?
Here's the problem: If you provide your own HttpClient whose inner message handler has AllowAutoRedirect
set to false, then Flurl's redirect features will work fine and there's no reason to throw or warn. But Flurl has no way to detect that - the handler isn't exposed via any property of HttpClient.
This gotcha is the main reason that 4.0 provides new hooks to configure the inner handler, which is preferred over providing your own client whenever possible. I think it would be preferable in your case.
Feel free to submit a PR for the docs if you want. The link above (under "a few words of caution") warns against tampering with AllowAutoRedirect
and UseCookies
, but not specific to the scenario of providing your own HttpClient.
from flurl.
Related Issues (20)
- client.Configure in 4.0.0 version? HOT 8
- Add `bool IFlurlClientCache.TryGet(string name, out IFlurlClient client)` HOT 1
- How can I speed limit when upload file HOT 1
- HttpTest WithRequestJson does not use JsonSerializer set on FlurlClientCache HOT 3
- Deadlock (or something weird) when calling `GetStringAsync` HOT 2
- 4.0.0 HOT 2
- System.EntryPointNotFoundException on PostJsonAsync HOT 1
- Add support for CancellationToken in IFlurlResponse asynchronous methods HOT 1
- Add option to disable conversion of plus signs to spaces for query parameters HOT 3
- According to RFC-7578 the Content-Disposition filename* parameter in multipart MUST NOT be used
- IFlurlClientBuilder.AddMiddleware cuts the chain of delegating handlers HOT 1
- Encode Issue HOT 2
- .net 8 blazor wasm PlatformNotSupportedException HOT 7
- GetJsonAsync<T> is not working after upgrading the Flurl Http to version 4 >= HOT 5
- The response ended prematurely HOT 2
- Trimming unused code causes the exception - Response could not be deserialized to JSON HOT 4
- Not able to configure Delegating handler in Flurl clientless DI configuration HOT 2
- Collection was modified; enumeration operation may not execute. HOT 1
- DownloadFileAsync => GetFileNameFromPath does not respect redirects HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flurl.