diff --git a/core/core.js b/core/core.js index 9db74919..4ff0599d 100644 --- a/core/core.js +++ b/core/core.js @@ -412,7 +412,7 @@ async function blobHandler(request, response, blobId, uri) { } if (!uri) { - response.writeHead(301, {"Location": "/" + blobId + "/"}); + response.writeHead(303, {"Location": 'http://' + request.headers.host + blobId + '/', "Content-Length": "0"}); response.end(data); return; } @@ -489,7 +489,7 @@ httpd.all("/login", auth.handler); httpd.all("", function(request, response) { var match; if (request.uri === "/" || request.uri === "") { - response.writeHead(303, {"Location": gGlobalSettings.index, "Content-Length": "0"}); + response.writeHead(303, {"Location": 'http://' + request.headers.host + gGlobalSettings.index, "Content-Length": "0"}); return response.end(); } else if (match = /^(\/~[^\/]+\/[^\/]+)(\/?.*)$/.exec(request.uri)) { return blobHandler(request, response, match[1], match[2]);