fix: need to add a strip prefix middleware
This commit is contained in:
parent
fba3ee4213
commit
fdef217078
|
@ -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
|
// Apply the middlewares to the tusJapeHandler
|
||||||
tusHandler := ApplyMiddlewares(tusJapeHandler, authMiddlewareFunc, protocolMiddleware)
|
tusHandler := ApplyMiddlewares(tusJapeHandler, stripPrefix, authMiddlewareFunc, protocolMiddleware)
|
||||||
|
|
||||||
return tusHandler
|
return tusHandler
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue