Skip to content
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

Stop using surf as http client #2335

Closed
tmpolaczyk opened this issue Jan 5, 2023 · 2 comments
Closed

Stop using surf as http client #2335

tmpolaczyk opened this issue Jan 5, 2023 · 2 comments
Assignees

Comments

@tmpolaczyk
Copy link
Contributor

When trying to prototype #2331, we have noticed that the surf client does not properly support HTTP HEAD requests. That issue has been reported on the surf repo more than two years ago, but it has not been fixed yet, even though it looks like a simple fix. And there are similar issues and FIXMEs in witnet-rust regarding surf issues, such as url parsing for example. Also, the last commit on the surf repo is from May 10, 2022, and it doesn't look very active anymore. Therefore it seems reasonable to stop using surf as a dependency.

Fortunately, we now have a witnet http client implemented here:

use std::convert::TryFrom;

That client is a wrapper over the isahc http client, of which surf is also a wrapper. So it should be straightforward to add the missing API there, and drop the dependency on surf. And since we will still be using isahc under the hood, this should be a minor change, and it shouldn't break any requests.

@aesedepece
Copy link
Member

This is a good idea. From what I remember when implementing the paranoid retrieval mode, it could save us as a lot of boilerplate around error types, etc.

@aesedepece
Copy link
Member

Solved by #2399

@aesedepece aesedepece self-assigned this Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants