Skip to content

[TokenObserver] Move query string to RawQuery#1714

Open
kylesmartin wants to merge 3 commits intomainfrom
fix/query-separator
Open

[TokenObserver] Move query string to RawQuery#1714
kylesmartin wants to merge 3 commits intomainfrom
fix/query-separator

Conversation

@kylesmartin
Copy link
Contributor

@kylesmartin kylesmartin commented Feb 19, 2026

We are passing a request path that contains a query string and requestURL.Path = path.Join(requestURL.Path, requestPath) ends up escaping the ? query separator.

The valid request is https://iris-api-sandbox.circle.com/v2/messages/21?transactionHash=0x7349965dea91d36e68854f79278ce1c6522bbac3840e9aa1b37c02009e6c1545.

Whereas we are sending https://iris-api-sandbox.circle.com/v2/messages/21%3FtransactionHash=0x7349965dea91d36e68854f79278ce1c6522bbac3840e9aa1b37c02009e6c1545.

Copilot AI review requested due to automatic review settings February 19, 2026 22:23
@kylesmartin kylesmartin requested review from a team as code owners February 19, 2026 22:23
@github-actions
Copy link

👋 kylesmartin, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug where query string separators ("?") were being escaped to "%3F" in HTTP request URLs. The issue occurred because path.Join() was being used on request paths that included query strings, causing the "?" character to be URL-encoded.

Changes:

  • Implemented splitPathAndQuery() helper function to separate path and query components before joining
  • Updated Get() and Post() methods to use the new helper and set RawQuery separately
  • Added comprehensive unit and integration tests to prevent regression
  • Removed unused assert import and standardized on require for test assertions

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
execute/tokendata/http/http.go Added splitPathAndQuery() helper function and updated Get() and Post() methods to properly handle query strings by setting RawQuery separately instead of escaping them in the path
execute/tokendata/http/http_test.go Added unit tests for splitPathAndQuery(), integration test for query string handling in GET/POST requests, converted assert to require for consistency, and removed unused assert import

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link

Metric fix/query-separator main
Coverage 70.1% 69.7%

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.

3 participants

Comments