refactor: add current request to tusJwtResponseWriter

This commit is contained in:
Derrick Hammer 2024-01-20 08:12:30 -05:00
parent 73fa265939
commit 9bf10b19bf
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 2 additions and 1 deletions

View File

@ -110,6 +110,7 @@ func AuthMiddleware(handler jape.Handler, portal interfaces.Portal) jape.Handler
type tusJwtResponseWriter struct {
http.ResponseWriter
req *http.Request
}
func (w *tusJwtResponseWriter) WriteHeader(statusCode int) {
@ -161,7 +162,7 @@ func BuildS5TusApi(portal interfaces.Portal) jape.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
res := w
if r.Method == http.MethodPost && r.URL.Path == "/s5/upload/tus" {
res = &tusJwtResponseWriter{ResponseWriter: w}
res = &tusJwtResponseWriter{ResponseWriter: w, req: r}
}
h.ServeHTTP(res, r)