diff --git a/OrbitalBeat.go b/OrbitalBeat.go index 18dcf76..fa790bb 100644 --- a/OrbitalBeat.go +++ b/OrbitalBeat.go @@ -147,7 +147,8 @@ func handleQueryRequest(ctx *fasthttp.RequestCtx, identifier cid.Cid, extraArgum //TODO: setting to hide filename ctx.Response.Header.Set("Content-Disposition", fmt.Sprintf("inline; filename*=utf-8''%s", url.PathEscape(filename))) - ctx.Request.SetRequestURI(cacheEntry.Entry.Path) + ctx.Request.URI().Reset() + ctx.Request.URI().SetPath(cacheEntry.Entry.Path) fsHandler(ctx) } @@ -594,6 +595,9 @@ func main() { Compress: false, CompressBrotli: false, CacheDuration: time.Minute * 15, + PathRewrite: func(ctx *fasthttp.RequestCtx) []byte { + return ctx.Request.URI().PathOriginal() + }, } fsHandler = fs.NewRequestHandler()