-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(dev): cosider base
when special-casing /_image
#10274
Conversation
🦋 Changeset detectedLatest commit: 527f699 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
packages/astro/src/core/request.ts
Outdated
if (removeParams && url.pathname !== '/_image') { | ||
if (staticLike && url.pathname !== `${prependForwardSlash(appendForwardSlash(base))}_image`) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix is here, the rest is clerical.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's very hard to read together with the template literal. Can we save the result at line 50 and then use it at line 52?
clientAddress: buildingToSSR ? incomingRequest.socket.remoteAddress : undefined, | ||
removeParams: buildingToSSR === false || route.prerender, | ||
clientAddress: incomingRequest.socket.remoteAddress, | ||
staticLike: config.output === "static" ? true : route.prerender, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
staticLike: config.output === "static" ? true : route.prerender, | |
staticLike: config.output === "static" || route.prerender, |
packages/astro/src/core/request.ts
Outdated
if (removeParams && url.pathname !== '/_image') { | ||
if (staticLike && url.pathname !== `${prependForwardSlash(appendForwardSlash(base))}_image`) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's very hard to read together with the template literal. Can we save the result at line 50 and then use it at line 52?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thank you @lilnasy! Happy to merge once a test is there and it passes
* main: (327 commits) [ci] format fix(node): listen on 0.0.0.0 if server.host is set to true (withastro#10282) [ci] format fix(dev): cosider `base` when special-casing `/_image` (withastro#10274) [ci] format update login flow to support Brave (withastro#10258) [ci] format improve link command (withastro#10257) Updates deprecated Node.js 16 github actions (withastro#10270) Fix Vitest check fail again (withastro#10266) [ci] format Adds auto completion of `astro:` events when adding or removing event listeners on `document` (withastro#10263) Update Vite to latest (withastro#10259) [ci] release (withastro#10236) [ci] format fix(i18n): localised index pages are overwritten (withastro#10250) fix: change strategy for route caching (withastro#10248) Fix TypeScript type definitions for `Code` component (withastro#10251) chang changeset (withastro#10253) Removes morph animations when setting transition:animate=none (withastro#10247) ...
Changes
parseURL
#10273Testing
Docs