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(gw): preserve query on website redirect #7727

Merged
merged 1 commit into from
Nov 10, 2020

Conversation

lidel
Copy link
Member

@lidel lidel commented Oct 13, 2020

TLDR We were losing query params on redirect, this PR fixes that.

This PR preserves query parameters during internal redirect of http gateway and adds sharness test to guard against regression in the way index.html detection works.

Description of fixed problem

When /foo?bar=buz was requested and /foo/index.html existed,
gateway redirected to /foo/ and that redirect did not preserve query params.

Problematic code was:

  1. https://github.com/ipfs/go-ipfs/blob/v0.7.0/core/corehttp/gateway_handler.go#L180
  2. https://github.com/ipfs/go-ipfs/blob/v0.7.0/core/corehttp/gateway_handler.go#L283-L285

cc @mburns @hsanjuan

@lidel lidel added topic/gateway Topic gateway need/review Needs a review labels Oct 13, 2020
@lidel lidel requested review from hsanjuan and aschmahmann October 13, 2020 23:01
@aschmahmann aschmahmann merged commit 0700c74 into master Nov 10, 2020
@lidel lidel deleted the fix/preserver-query-on-website-redirect branch November 13, 2020 14:06
@aschmahmann aschmahmann mentioned this pull request Feb 18, 2021
73 tasks
hacdias pushed a commit to ipfs/boxo that referenced this pull request Jan 27, 2023
…bsite-redirect

fix(gw): preserve query on website redirect

This commit was moved from ipfs/kubo@0700c74
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need/review Needs a review topic/gateway Topic gateway
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants