mirror of
https://github.com/withastro/astro.git
synced 2025-01-22 10:31:53 -05:00
[ci] format
This commit is contained in:
parent
bbf1d8894e
commit
df90e6dfad
2 changed files with 6 additions and 3 deletions
|
@ -6,8 +6,8 @@ import type { ModuleLoader } from '../core/module-loader/index.js';
|
|||
import { Readable } from 'node:stream';
|
||||
import { getSetCookiesFromResponse } from '../core/cookies/index.js';
|
||||
import { getViteErrorPayload } from '../core/errors/dev/index.js';
|
||||
import notFoundTemplate from '../template/4xx.js';
|
||||
import { redirectTemplate } from '../core/routing/3xx.js';
|
||||
import notFoundTemplate from '../template/4xx.js';
|
||||
|
||||
export async function handle404Response(
|
||||
origin: string,
|
||||
|
@ -54,7 +54,11 @@ export function writeHtmlResponse(res: http.ServerResponse, statusCode: number,
|
|||
res.end();
|
||||
}
|
||||
|
||||
export function writeRedirectResponse(res: http.ServerResponse, statusCode: number, location: string) {
|
||||
export function writeRedirectResponse(
|
||||
res: http.ServerResponse,
|
||||
statusCode: number,
|
||||
location: string,
|
||||
) {
|
||||
const html = redirectTemplate({ status: statusCode, location });
|
||||
res.writeHead(statusCode, {
|
||||
Location: location,
|
||||
|
|
|
@ -60,7 +60,6 @@ describe('Development Routing', () => {
|
|||
assert.equal(response.headers.get('Location'), '/');
|
||||
});
|
||||
|
||||
|
||||
it('404 when loading invalid dynamic route', async () => {
|
||||
const response = await fixture.fetch('/2');
|
||||
assert.equal(response.status, 404);
|
||||
|
|
Loading…
Reference in a new issue