fix: no fixup if X-Ipfs-Gateway-Prefix is present
https://github.com/ipfs/go-ipfs/pull/7930#discussion_r597976690
Marcin Rataj committed
Mar 20, 2021 at 00:00 UTC
763a120ed28c6cd2e77077c6bb0281c583a6b580
1 file changed
+1
-1
core/corehttp/gateway_handler.go
+1
-1
@@ -238,7 +238,7 @@ func (i *gatewayHandler) getOrHeadHandler(w http.ResponseWriter, r *http.Request
238
239
parsedPath := ipath.New(urlPath)
240
if pathErr := parsedPath.IsValid(); pathErr != nil {
241
- if fixupSuperfluousNamespace(w, urlPath, r.URL.RawQuery) {
241
+ if prefix == "" && fixupSuperfluousNamespace(w, urlPath, r.URL.RawQuery) {
242
// the error was due to redundant namespace, which we were able to fix
243
// by returning error/redirect page, nothing left to do here
244
return