fix: we don't need to wrap the tus middleware as NewHandler does it for us

This commit is contained in:
Derrick Hammer 2024-01-20 05:45:13 -05:00
parent eb063a8954
commit fba3ee4213
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 1 additions and 3 deletions

View File

@ -102,8 +102,6 @@ func AuthMiddleware(handler jape.Handler, portal interfaces.Portal) jape.Handler
}
func BuildS5TusApi(portal interfaces.Portal) jape.Handler {
// Adapt the tus middleware to a function that transforms jape.Handler
adaptedTusMiddleware := jape.Adapt(portal.Storage().Tus().Middleware)
// Wrapper function for AuthMiddleware to fit the MiddlewareFunc signature
authMiddlewareFunc := func(h jape.Handler) jape.Handler {
@ -124,7 +122,7 @@ func BuildS5TusApi(portal interfaces.Portal) jape.Handler {
})
// Apply the middlewares to the tusJapeHandler
tusHandler := ApplyMiddlewares(tusJapeHandler, adaptedTusMiddleware, authMiddlewareFunc, protocolMiddleware)
tusHandler := ApplyMiddlewares(tusJapeHandler, authMiddlewareFunc, protocolMiddleware)
return tusHandler
}