Use ureq instead of reqwest#8
Conversation
… utils.rs structure
…improved utils.rs structure
|
@race-of-sloths score 8 |
|
@oleksandrvoyager Thank you for your contribution! Your pull request is now a part of the Race of Sloths! Current status: executed
Your contribution is much appreciated with a final score of 8! @artob received 25 Sloth Points for reviewing and scoring this pull request. What is the Race of SlothsRace of Sloths is a friendly competition where you can participate in challenges and compete with other open-source contributors within your normal workflow For contributors:
For maintainers:
Feel free to check our website for additional details! Bot commands
|
There was a problem hiding this comment.
Pull Request Overview
This PR replaces reqwest with ureq across HTTP, HTTPS, IPFS, and Git schemes and introduces a unified request abstraction with customizable headers.
- Introduce
schemes/request.rsto centralizeureqagent creation and fetching logic. - Refactor
http.rs,https,ipfs.rs, andgit.rsto use the new request module and supportRequestConfig. - Add
RequestConfiginlib.rsandopen_with_configinopen.rsfor passing custom headers to all schemes.
Reviewed Changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/gofer/src/schemes/request.rs | New ureq agent builder and fetch functions |
| lib/gofer/src/schemes/ipfs.rs | IPFS open/open_with_config refactored to ureq |
| lib/gofer/src/schemes/http.rs | HTTP/HTTPS open functions refactored to ureq |
| lib/gofer/src/schemes/git.rs | Git open/open_with_config refactored to ureq |
| lib/gofer/src/schemes.rs | Register new request module under relevant features |
| lib/gofer/src/open.rs | Added open_with_config dispatch across schemes |
| lib/gofer/src/lib.rs | Defined RequestConfig type and methods |
| lib/gofer/src/error.rs | Switched error conversions from reqwest to ureq |
| lib/gofer/Cargo.toml | Removed reqwest dependency, added optional ureq |
Comments suppressed due to low confidence (2)
lib/gofer/src/schemes/request.rs:13
- [nitpick] The parameter
use_tlsis semantically equivalent tosecureused elsewhere; consider renaming it tosecurefor consistency across the API.
pub(crate) fn new_agent(use_tls: bool, tls_provider: Option<TlsProvider>) -> Agent {
lib/gofer/src/schemes/ipfs.rs:65
- There are no tests covering
map_ipfs_url_to_gateway_url; adding unit tests for valid and invalid IPFS URL mappings would help prevent regressions.
fn map_ipfs_url_to_gateway_url(url_str: &str) -> Result<String> {
No description provided.