breaking: Replace reqwest with ureq. - #200
Merged
Merged
Conversation
This reverts commit 1d3c41e.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Swaps
reqwestforureqbehind theurlfeature.ureqis blocking, but it never builds aruntime of its own, so loading a URL from inside an async runtime now blocks the calling thread
instead of panicking.
That panic is what an earlier async-loading experiment on this branch was working around. Switching
clients removes the need for it, so the loader stays entirely synchronous.
Fixes HTTPS for everyone downstream
reqwestwas declareddefault-features = falsewith onlyblocking, which leaves it without aTLS backend. The
rustlsfeature was only present in dev-dependencies, so HTTPS worked in thisrepository — where Cargo unifies the two — and nowhere else.
A standalone crate depending on
schematicwithfeatures = ["config", "url"]fails on any HTTPSrequest before this change and loads fine after it. Since
is_secure_urlrejects anything but HTTPSoutside of loopback, the feature was effectively unusable as published.
ureqenables rustls bydefault.
Behaviour changes
ConfigError::ReadUrlFailednow carries aureq::Errorrather than areqwest::Error. Breakingfor anyone matching on it.
ReadUrlFailed.reqwestreturnedOkregardless of status, so a404 previously handed its error page to the parser and surfaced as a confusing parse error.
Dependencies
Net 47 fewer packages — the tokio, hyper, and h2 stack drops out, taking roughly 540 lines of
Cargo.lockwith it.Tests
Three added to
url_sources_test: loading from inside an async runtime, which pins the propertythis swap exists for; the 404 case; and the existing network-backed suite continues to pass
unchanged.
tokiois a dev-dependency solely to drive the first one.Also corrects a stray claim in the book that the
urlfeature is enabled by default — it is not,and never has been.
🤖 Generated with Claude Code