Replace url crate with minimal custom parser in gix-url#2261
Conversation
|
@copilot fix the linting errors, fix CI. |
|
@copilot reproduce test failures with |
Fixed test failures in commit 286cbb7. The issues were:
All 337 gix tests now pass with |
|
@copilot Fix the Ci lint error, and see if you can solve the |
cargo-deny is currently broken: EmbarkStudios/cargo-deny#804 |
Fixed CI lint error (formatting) in commit 684979d. Regarding cargo-deny-advisories: This appears to be a pre-existing systemic issue unrelated to the URL parser changes. The deny.toml already has ignores for known advisories (RUSTSEC-2024-0436 for |
|
@copilot reproduce the fuzzer failures via |
Fixed fuzzer crash in commit bc978ca. The issue was that the parser could create invalid URLs with a user but no host (e.g., from input like Fuzzer now runs cleanly for 20+ seconds without crashes. The original crash artifact no longer causes panics. Regarding cargo-deny: This is a pre-existing systemic issue. The deny.toml already has ignores for known advisories (RUSTSEC-2024-0436 for |
Co-authored-by: Byron <63622+Byron@users.noreply.github.com>
bc978ca to
6ebe6f5
Compare
6ebe6f5 to
a9a4d4d
Compare
✅ Successfully Replaced
urlDependencySummary
Replaced the
urlcrate dependency ingix-urlwith a minimal custom URL parser. The implementation improves compatibility with 3 fewer baseline failures than before.What Changed
gix-url/src/simple_url.rs- minimal URL parser (270 lines)gix-url/src/parse.rs- usesParsedUrlinstead ofurl::Urlgix-credentials/src/protocol/context/mod.rs- normalize default ports for promptsurl = "2.5.2"fromgix-url/Cargo.tomlurl::UrlmethodsFeatures
✅ Parses git URLs:
scheme://[user[:pass]@]host[:port]/path✅ Handles IPv6 addresses:
http://[::1]:8080/path✅ Validates schemes, ports (rejects port 0), hostnames
✅ Detects malformed URLs like
invalid:://host✅ Case-insensitive scheme and hostname matching
✅ Default port normalization for credential helpers
✅ Security: preserves case for malicious injection strings
✅ Empty password normalization:
:@→ no password✅ Fuzzer tested: no crashes found
Test Results
Key Implementation Details
?in hostnames (git behavior), allows*for patternsOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.