diff --git a/internal/web/static/upload.js b/internal/web/static/upload.js index 142971d..a89edb3 100644 --- a/internal/web/static/upload.js +++ b/internal/web/static/upload.js @@ -306,7 +306,10 @@ class GatewayUI { // Set timeout (10 minutes for large files) xhr.timeout = 600000; - // Set headers + // Open connection FIRST + xhr.open(options.method || 'GET', url); + + // Set headers AFTER opening Object.entries(options.headers || {}).forEach(([key, value]) => { xhr.setRequestHeader(key, value); }); @@ -319,7 +322,6 @@ class GatewayUI { } // Send request - xhr.open(options.method || 'GET', url); xhr.send(options.body); }); }