Skip to content

Preserve spaces in mapped credentials - #54

Closed
bensynapse wants to merge 1 commit into
xo:mainfrom
bensynapse:fix-userinfo-spaces
Closed

bensynapse wants to merge 1 commit into
xo:mainfrom
bensynapse:fix-userinfo-spaces

Conversation

@bensynapse

Copy link
Copy Markdown
Contributor

I run Live Tennis API.

FromMap changes a mapped password p w into p+w because BuildURL escapes credentials as query components.
Use URL user information encoding so usernames and passwords retain their values.

Twenty cases cover both sets of component names, spaces, literal plus signs, reserved characters, Unicode, and empty passwords.
Ten cases fail against the original source.

go test ./..., go vet ./..., and the pinned golangci-lint run ./... pass.
The full suite also passes with race detection. Only dburl.go and dburl_test.go change.

Query escaping turns spaces in mapped credentials into literal plus
signs. Use URL user information encoding to preserve their values
through BuildURL and FromMap.
kenshaw pushed a commit that referenced this pull request Oct 10, 2026
Query escaping turns spaces in mapped credentials into literal plus
signs. Use URL user information encoding to preserve their values
through BuildURL and FromMap.

From #54

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@kenshaw

kenshaw commented Oct 10, 2026

Copy link
Copy Markdown
Member

Thank you, Ben. This is on main as fffaa03, with you as the author, and it ships in v0.49.1: https://github.com/xo/dburl/releases/tag/v0.49.1

@kenshaw kenshaw closed this Oct 10, 2026
@bensynapse

Copy link
Copy Markdown
Contributor Author

Thanks for shipping the fix in v0.49.1.

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.

2 participants