Fix #86: don't decode query, fragment and user info in uri-with-query - #87
Merged
borkdude merged 1 commit intoSep 10, 2026
Merged
Conversation
…th-query babashka#68 changed the path component to `.getRawPath`, but the authority, query and fragment were left on the decoded getters, so any percent-escape outside the path is lost once `:query-params` are used: `?q=a%26b` goes out as `?q=a&b` (one parameter becomes two), `%2B` becomes `+`, and `%20` in the query or fragment throws URISyntaxException before the request is sent. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011M5uTyCU4WcNTsPvGrErDo
Contributor
|
Thanks! |
borkdude
added a commit
that referenced
this pull request
Sep 10, 2026
…#87) query and fragment were left on the decoded getters, so any percent-escape outside the path is lost once `:query-params` are used: `?q=a%26b` goes out as `?q=a&b` (one parameter becomes two), `%2B` becomes `+`, and `%20` in the query or fragment throws URISyntaxException before the request is sent. Co-authored-by: Dylan Pulver <dylanpulver@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #86.
uri-with-queryrebuilds the URI string from.getRawPath(fixed in #68) but from the decoded.getAuthority,.getQueryand.getFragment, so percent-escapes outside the path are lost whenever:query-paramsare used. Against a local echo server,(http/get ".../search?q=a%26b" {:query-params {"page" 2}})sends/search?q=a&b&page=2— one parameter silently becomes two; without:query-paramsthe same URL sends/search?q=a%26b.%2Bbecomes+, and%20in the query or fragment throwsURISyntaxExceptionbefore anything is sent.So: the remainder of #68, three more getters moved to their
Rawsiblings. The adjacent(comment ...)block's stale values are fixed too.Rejected alternative: rebuild with the multi-arg
java.net.URIconstructor and let it re-encode. It leaves%26/%2Bbroken, re-breaks the #68 path fix, and double-encodes the new query (q=%26moo→q=%2526moo), failing the existing test — what the docstring already warns about.bb test:clj :clj-all+bb test:bb: 128 assertions onmain, 132 here, 0 failures both; all four new ones fail onmain.clj-kondounchanged.🤖 Generated with Claude Code
https://claude.ai/code/session_011M5uTyCU4WcNTsPvGrErDo