Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
lilnasy committed Feb 29, 2024
1 parent 302d6b9 commit b818e2f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/astro/src/core/request.ts
Expand Up @@ -47,8 +47,10 @@ export function createRequest({

if (typeof url === 'string') url = new URL(url);

const imageEndpoint = prependForwardSlash(appendForwardSlash(base)) + '_image';

// HACK! astro:assets uses query params for the injected route in `dev`
if (staticLike && url.pathname !== `${prependForwardSlash(appendForwardSlash(base))}_image`) {
if (staticLike && url.pathname !== imageEndpoint) {
url.search = '';
}

Expand Down
2 changes: 1 addition & 1 deletion packages/astro/src/vite-plugin-astro-server/route.ts
Expand Up @@ -227,7 +227,7 @@ export async function handleRoute({
body,
logger,
clientAddress: incomingRequest.socket.remoteAddress,
staticLike: config.output === "static" ? true : route.prerender,
staticLike: config.output === "static" || route.prerender,
});

// Set user specified headers to response object.
Expand Down

0 comments on commit b818e2f

Please sign in to comment.