Skip to content
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

Merged
merged 5 commits into from
Feb 29, 2024

Conversation

lilnasy
Copy link
Contributor

@lilnasy lilnasy commented Feb 29, 2024

Changes

Testing

  • Manually checked with the repro, test pending.

Docs

  • Does not affect usage.

Copy link

changeset-bot bot commented Feb 29, 2024

🦋 Changeset detected

Latest 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

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Feb 29, 2024
Comment on lines 41 to 52
if (removeParams && url.pathname !== '/_image') {
if (staticLike && url.pathname !== `${prependForwardSlash(appendForwardSlash(base))}_image`) {
Copy link
Contributor Author

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.

Copy link
Member

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,
Copy link
Member

@ematipico ematipico Feb 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
staticLike: config.output === "static" ? true : route.prerender,
staticLike: config.output === "static" || route.prerender,

Comment on lines 41 to 52
if (removeParams && url.pathname !== '/_image') {
if (staticLike && url.pathname !== `${prependForwardSlash(appendForwardSlash(base))}_image`) {
Copy link
Member

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?

Copy link
Member

@ematipico ematipico left a 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

@lilnasy lilnasy marked this pull request as ready for review February 29, 2024 16:14
@lilnasy lilnasy merged commit e556151 into withastro:main Feb 29, 2024
13 checks passed
@lilnasy lilnasy deleted the fix/10273 branch February 29, 2024 18:38
@astrobot-houston astrobot-houston mentioned this pull request Feb 29, 2024
peng added a commit to peng/astro that referenced this pull request Mar 4, 2024
* 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)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect transform returned by parseURL
3 participants