Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 2, 2025

Dots (.) in usernames and passwords were incorrectly URL-encoded as %2E during serialization. Fixes gitbutlerapp/gitbutler#11419.

// Before: http://user%2Ename:pass%2Eword@example.com/repo
// After:  http://user.name:pass.word@example.com/repo
let url = gix_url::Url::from_parts(
    Scheme::Http,
    Some("user.name".into()),
    Some("pass.word".into()),
    Some("example.com".into()),
    None,
    "/repo".into(),
    false,
)?;

Changes

  • gix-url/src/lib.rs: Replace NON_ALPHANUMERIC encoding with RFC 3986-compliant USERINFO_ENCODE_SET that preserves unreserved chars (. - _ ~)
  • gix-url/tests/url/parse/http.rs: Add roundtrip tests for dots in username, password, and both
  • gix-url/tests/url/parse/ssh.rs: Add roundtrip test for dots in SSH usernames
  • gix-url/tests/fixtures/make_baseline.sh: Add baseline URLs with dotted usernames (ssh://user.name@host/repo, git://user.name@host/repo, user.name@host:repo)
Original prompt

Add tests to the gix-url baseline tests and serialisation tests that validate that . in user names won't be URL encoded. The same is true for passwords. See gitbutlerapp/gitbutler#11419 for reference.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Add tests for user and password encoding in gix-url fix: prevent dots from being URL-encoded in userinfo Dec 2, 2025
Copilot AI requested a review from Byron December 2, 2025 04:19
Copilot finished work on behalf of Byron December 2, 2025 04:19
Copilot AI and others added 2 commits December 2, 2025 08:06
Co-authored-by: Byron <63622+Byron@users.noreply.github.com>
- make clearer where percent encoding is used.
- add more generalised tests for user.name kind of user names.
@Byron Byron force-pushed the copilot/add-tests-for-user-password-encoding branch from 2318ab4 to 87048a3 Compare December 2, 2025 07:16
@Byron Byron marked this pull request as ready for review December 2, 2025 07:17
@Byron Byron enabled auto-merge December 2, 2025 07:17
@Byron Byron mentioned this pull request Dec 2, 2025
3 tasks
@Byron Byron merged commit e871c55 into main Dec 2, 2025
28 checks passed
@Byron Byron deleted the copilot/add-tests-for-user-password-encoding branch December 2, 2025 08:00
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.

Dot in SSH username encoded as %2E in remote URL when cloning

2 participants