-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
Additional cookie features #215
Comments
It may also be nice to expose the cookie parsing capability without necessarily enabling the cookie jar, so that you could do something like We'll have to expose some details of the |
Implement an interceptors API and remove the old middleware API. The new interceptors API is gated behind the `unstable-interceptors` feature flag. We sort of need to rush this out the door in order to implement #215 properly, but we're not ready to finalize the design yet. There are still some open problems to fix with this: - `from_fn` doesn't work as desired. The trait bounds are too ambiguous for the compiler to infer for closures, and since the return type is generic over a lifetime, there's no way to give the return type the correct name using current Rust syntax. - `InterceptorObj` wraps the returned future in an extra box. - If an interceptor returns a custom error, it is stringified and wrapped in `Error::Curl`. We should introduce a new error variant that boxes the error and also records the type of the interceptor that created the error for visibility. - Automatic redirect following currently bypasses interceptors for subsequent requests. This will be fixed when redirect handling is rewritten as an interceptor itself. See #232. Users who are eager for interceptors can also opt-in to this feature and start experimenting if they can't wait for stabilization. Related: #42
Expose a public API for setting a cookie jar and accessing it again for clients, requests, and responses. This is not a complete API solution to solve #215, but it gets us closer. This also includes a major internal refactoring of the cookie jar and cookie parsing which will help us with solidifying the desired API.
A minimal API for this is now available in the 0.9.11 release! It is limited to the basics of accessing cookies in the cookie jar by URI and name, though in the future we can expand the API to do more things, such as creating and persisting artificial cookies, getting cookie attributes, etc. |
Allow reading of current stored cookies with something like a client.get_cookies() function.
The text was updated successfully, but these errors were encountered: