fix: need to add a strip prefix middleware

This commit is contained in:
Derrick Hammer 2024-01-20 05:50:54 -05:00
parent fba3ee4213
commit fdef217078
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 7 additions and 1 deletions

View File

@ -121,8 +121,14 @@ func BuildS5TusApi(portal interfaces.Portal) jape.Handler {
})
})
stripPrefix := func(h jape.Handler) jape.Handler {
return jape.Adapt(func(h http.Handler) http.Handler {
return http.StripPrefix("/s5/tus/upload/", h)
})(h)
}
// Apply the middlewares to the tusJapeHandler
tusHandler := ApplyMiddlewares(tusJapeHandler, authMiddlewareFunc, protocolMiddleware)
tusHandler := ApplyMiddlewares(tusJapeHandler, stripPrefix, authMiddlewareFunc, protocolMiddleware)
return tusHandler
}