Skip to content

Fix from-curl proto schemeless URL handling#770

Merged
ryanfowler merged 1 commit into
mainfrom
codex/fix-from-curl-proto-schemeless-url
Jun 15, 2026
Merged

Fix from-curl proto schemeless URL handling#770
ryanfowler merged 1 commit into
mainfrom
codex/fix-from-curl-proto-schemeless-url

Conversation

@ryanfowler

Copy link
Copy Markdown
Owner

Summary

Fix --from-curl --proto handling for schemeless URLs that contain :// later in the path, query, or fragment.

The previous check used a loose split_once("://"), which could mistake text after the authority position for an explicit URL scheme. This meant a command such as curl --proto '=http' example.com/path://still could bypass the intended schemeless defaulting path and later normalize as HTTPS.

This change reuses the HTTP URL authority-scheme detector so --from-curl --proto only treats a URL as explicitly schemed when the scheme appears before /, ?, or # and is followed by //. Regression coverage now covers :// in the path, query, and fragment.

Validation

  • cargo fmt
  • cargo fmt --check
  • cargo clippy --locked --all-targets --all-features -- -D warnings
  • cargo test --locked --all-features --lib --bins
  • cargo test --locked --all-features from_curl_proto
  • cargo test --locked --all-features authority_scheme_detection_requires_valid_leading_scheme

@ryanfowler ryanfowler changed the title [codex] Fix from-curl proto schemeless URL handling Fix from-curl proto schemeless URL handling Jun 15, 2026
@ryanfowler ryanfowler marked this pull request as ready for review June 15, 2026 22:35
@ryanfowler ryanfowler enabled auto-merge June 15, 2026 22:36
@ryanfowler ryanfowler merged commit b1e428f into main Jun 15, 2026
4 checks passed
@ryanfowler ryanfowler deleted the codex/fix-from-curl-proto-schemeless-url branch June 15, 2026 22:39
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

Successfully merging this pull request may close these issues.

1 participant