Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
ascorbic authored and astrobot-houston committed Jan 16, 2025
1 parent bbf1d88 commit df90e6d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 6 additions & 2 deletions packages/astro/src/vite-plugin-astro-server/response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion packages/astro/test/dev-routing.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit df90e6d

Please sign in to comment.