Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upgrade Go to 1.22, adapt to http server URL changes #494

Merged
merged 2 commits into from
Dec 17, 2024

Conversation

rvagg
Copy link
Member

@rvagg rvagg commented Dec 17, 2024

Strange behaviour causing e2e test failures when upgrading to 1.22, diagnosed as a different form that an HTTP server decodes a request and doesn't fully unescape its Path when it has special characters in it. This seems to be related to the new ServeMux changes in 1.22 because GODEBUG=httpmuxgo121=1 reverts the behaviour and the test passes.
The fix is to explicitly unescape the path before passing it on, go-trustless-utils will re-escape itself when it builds a new request to pass on downstream, but in the meantime we need to know the exact unescaped path so we can traverse it to validate the incoming data as well as pass it on upstream to the remote.

@codecov-commenter
Copy link

codecov-commenter commented Dec 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.69%. Comparing base (6ccf6ac) to head (2aeae59).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #494      +/-   ##
==========================================
+ Coverage   75.42%   75.69%   +0.27%     
==========================================
  Files          87       87              
  Lines        6656     6661       +5     
==========================================
+ Hits         5020     5042      +22     
+ Misses       1350     1343       -7     
+ Partials      286      276      -10     
Files with missing lines Coverage Δ
pkg/server/http/ipfs.go 87.79% <100.00%> (+0.24%) ⬆️

... and 7 files with indirect coverage changes

Strange behaviour causing e2e test failures when upgrading to 1.22, diagnosed
as a different form that an HTTP server decodes a request and doesn't fully
unescape its `Path` when it has special characters in it. This seems to be
related to the new ServeMux changes in 1.22 because GODEBUG=httpmuxgo121=1
reverts the behaviour and the test passes.
The fix is to explicitly unescape the path before passing it on,
go-trustless-utils will re-escape itself when it builds a new request to
pass on downstream, but in the meantime we need to know the exact unescaped
path so we can traverse it to validate the incoming data as well as pass it on
upstream to the remote.
pkg/internal/itest/e2e_test.go Outdated Show resolved Hide resolved
@rvagg rvagg merged commit 53f405f into main Dec 17, 2024
9 checks passed
@rvagg rvagg deleted the rvagg/upgrade-go branch December 17, 2024 05:57
@rvagg rvagg mentioned this pull request Dec 17, 2024
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