rename
This commit is contained in:
parent
0b232095bf
commit
d59f3bd6d7
1 changed files with 4 additions and 4 deletions
|
@ -38,7 +38,7 @@ export function createServer(
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
let pathForSend = encodedURI;
|
let pathToSend = encodedURI;
|
||||||
|
|
||||||
if (trailingSlash === 'never') {
|
if (trailingSlash === 'never') {
|
||||||
if (pathname.endsWith('/')) {
|
if (pathname.endsWith('/')) {
|
||||||
|
@ -49,10 +49,10 @@ export function createServer(
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pathForSend = encodedURI + '/';
|
pathToSend = encodedURI + '/';
|
||||||
}
|
}
|
||||||
|
|
||||||
const stream = send(req, pathForSend, {
|
const stream = send(req, pathToSend, {
|
||||||
root: fileURLToPath(client),
|
root: fileURLToPath(client),
|
||||||
dotfiles: pathname.startsWith('/.well-known/') ? 'allow' : 'deny',
|
dotfiles: pathname.startsWith('/.well-known/') ? 'allow' : 'deny',
|
||||||
});
|
});
|
||||||
|
@ -79,7 +79,7 @@ export function createServer(
|
||||||
location = req.url + '/';
|
location = req.url + '/';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pathForSend.endsWith('/')) {
|
if (!pathToSend.endsWith('/')) {
|
||||||
res.statusCode = 301;
|
res.statusCode = 301;
|
||||||
res.setHeader('Location', location);
|
res.setHeader('Location', location);
|
||||||
res.end(location);
|
res.end(location);
|
||||||
|
|
Loading…
Reference in a new issue