mirror of
https://github.com/withastro/astro.git
synced 2024-12-23 21:53:55 -05:00
[ci] format
This commit is contained in:
parent
781f558c40
commit
b064ca6539
2 changed files with 5 additions and 5 deletions
|
@ -58,7 +58,7 @@ export function createServer(
|
||||||
stream.on('directory', () => {
|
stream.on('directory', () => {
|
||||||
// On directory find, redirect to the trailing slash
|
// On directory find, redirect to the trailing slash
|
||||||
const location = req.url + '/';
|
const location = req.url + '/';
|
||||||
res.statusCode = 301
|
res.statusCode = 301;
|
||||||
res.setHeader('Location', location);
|
res.setHeader('Location', location);
|
||||||
res.end(location);
|
res.end(location);
|
||||||
});
|
});
|
||||||
|
|
|
@ -61,7 +61,7 @@ describe('Prerendering', () => {
|
||||||
|
|
||||||
it('Omitting the trailing slash results in a redirect that includes the base', async () => {
|
it('Omitting the trailing slash results in a redirect that includes the base', async () => {
|
||||||
const res = await fetch(`http://${server.host}:${server.port}/some-base/two`, {
|
const res = await fetch(`http://${server.host}:${server.port}/some-base/two`, {
|
||||||
redirect: 'manual'
|
redirect: 'manual',
|
||||||
});
|
});
|
||||||
expect(res.status).to.equal(301);
|
expect(res.status).to.equal(301);
|
||||||
expect(res.headers.get('location')).to.equal('/some-base/two/');
|
expect(res.headers.get('location')).to.equal('/some-base/two/');
|
||||||
|
|
Loading…
Reference in a new issue