Skip to content

Commit

Permalink
another redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
gammazero committed Jan 8, 2025
1 parent 8ff7f6c commit e533ecc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gateway/handler_codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ func (i *handler) serveCodecHTML(ctx context.Context, w http.ResponseWriter, r *
suffix := "/"
// preserve query parameters
if r.URL.RawQuery != "" {
suffix = suffix + "?" + r.URL.RawQuery
suffix = suffix + "?" + url.PathEscape(r.URL.RawQuery)

Check warning on line 173 in gateway/handler_codec.go

View check run for this annotation

Codecov / codecov/patch

gateway/handler_codec.go#L173

Added line #L173 was not covered by tests
}
// /ipfs/cid/foo?bar must be redirected to /ipfs/cid/foo/?bar
redirectURL := requestURI.Path + suffix
redirectURL := requestURI.EscapedPath() + suffix
http.Redirect(w, r, redirectURL, http.StatusMovedPermanently)
return true
}
Expand Down

0 comments on commit e533ecc

Please sign in to comment.