Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
tony-sull authored and github-actions[bot] committed May 18, 2022
1 parent 0d3c673 commit f1d7d54
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions packages/astro/src/vite-plugin-astro-server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,10 @@ async function handleRequest(
// When file-based build format is used, pages will be built to `/blog.html`
// rather than `/blog/index.html`. The dev server should handle this as well
// to match production deployments.
const url = config.build.format === 'file'
? new URL(origin + req.url?.replace(/(index)?\.html$/, ''))
: new URL(origin + req.url);
const url =
config.build.format === 'file'
? new URL(origin + req.url?.replace(/(index)?\.html$/, ''))
: new URL(origin + req.url);
const pathname = decodeURI(url.pathname);
const rootRelativeUrl = pathname.substring(devRoot.length - 1);
if (!buildingToSSR) {
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/test/dev-routing.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ describe('Development Routing', () => {
const response = await fixture.fetch('/1.html');
expect(response.status).to.equal(200);
});

it('200 when loading /1', async () => {
const response = await fixture.fetch('/1');
expect(response.status).to.equal(200);
Expand Down

0 comments on commit f1d7d54

Please sign in to comment.