Use full original path for handler
This commit is contained in:
parent
e4af79d85f
commit
a0ff9a73b5
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue