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

fix(gateway): question marks in url.Path when redirecting #313

Merged
merged 2 commits into from
Jun 2, 2023
Merged

Conversation

hacdias
Copy link
Member

@hacdias hacdias commented May 24, 2023

Fixes ipfs/kubo#9882, fixes ipfs/ipfs-companion#1201. I updated toSubdomainURL to use the url.URL struct from Go to build the final URL. The problem was that rest was the original, decoded, r.URL.Path and it contains a ?. When Go parses it, it'd consider it as a query element, rightly so.

Kubo PR: ipfs/kubo#9894

@codecov
Copy link

codecov bot commented May 24, 2023

Codecov Report

Merging #313 (77afd71) into main (1464d19) will decrease coverage by 0.50%.
The diff coverage is 78.57%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #313      +/-   ##
==========================================
- Coverage   50.62%   50.13%   -0.50%     
==========================================
  Files         280      280              
  Lines       33724    33714      -10     
==========================================
- Hits        17074    16901     -173     
- Misses      14870    15029     +159     
- Partials     1780     1784       +4     
Impacted Files Coverage Δ
gateway/hostname.go 68.01% <78.57%> (+0.73%) ⬆️

... and 17 files with indirect coverage changes

@hacdias hacdias force-pushed the issues/9882 branch 2 times, most recently from c1c828e to 28b1b54 Compare May 24, 2023 13:33
gateway/hostname.go Outdated Show resolved Hide resolved
@BigLep BigLep mentioned this pull request May 31, 2023
5 tasks
Copy link
Member

@lidel lidel left a comment

Choose a reason for hiding this comment

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

I've tested this in Kubo (ipfs/kubo#9894) and works as expected.
I've resolved conflicts in 77afd71 and tested again locally, still good.

Merging, to bubble up to ipfs/kubo#9894.
@hacdias please see my comment there for next steps 🙏

@lidel lidel changed the title fix(gateway): correctly handle question marks in url.Path when redirecting fix(gateway): question marks in url.Path when redirecting Jun 2, 2023
@lidel lidel merged commit 20e2aae into main Jun 2, 2023
@lidel lidel deleted the issues/9882 branch June 2, 2023 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Archived in project
3 participants