From d6fc603e4c50338d929f4a8bd285cee514d91fb7 Mon Sep 17 00:00:00 2001 From: Alexander Andryashin Date: Fri, 5 Nov 2021 20:43:22 +0300 Subject: [PATCH] Fixed file upload. --- selenoid.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/selenoid.go b/selenoid.go index e625ac7b..bb23ace1 100644 --- a/selenoid.go +++ b/selenoid.go @@ -510,6 +510,10 @@ func proxy(w http.ResponseWriter, r *http.Request) { return } } + seUploadPath, uploadPath := "/se/file", "/file" + if strings.HasSuffix(r.URL.Path, seUploadPath) { + r.URL.Path = strings.TrimSuffix(r.URL.Path, seUploadPath)+uploadPath + } r.URL.Host, r.URL.Path = sess.URL.Host, path.Clean(sess.URL.Path+r.URL.Path) r.Host = "localhost" return