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 build base bug #3068

Merged
merged 5 commits into from
Apr 13, 2022
Merged

fix build base bug #3068

merged 5 commits into from
Apr 13, 2022

Conversation

FredKSchott
Copy link
Member

Changes

  • Fixes an issue with build not respecting base config

Testing

  • Updated tests.

Docs

  • N/A

@changeset-bot
Copy link

changeset-bot bot commented Apr 11, 2022

🦋 Changeset detected

Latest commit: 5961975

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
astro Patch

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 pkg: astro Related to the core `astro` package (scope) test labels Apr 11, 2022
Base automatically changed from fix-url-search-params-bug to main April 11, 2022 22:57
@tony-sull tony-sull linked an issue Apr 12, 2022 that may be closed by this pull request
1 task
Copy link
Contributor

@tony-sull tony-sull left a comment

Choose a reason for hiding this comment

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

Looks good to me! Added a question just as a sanity check but this fix + test should have it covered 👍

@@ -191,7 +191,7 @@ async function generatePath(
}

const ssr = isBuildingToSSR(opts.astroConfig);
const url = new URL(origin + pathname);
const url = new URL(opts.astroConfig.base + pathname.substring(1), origin);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the answer here is yes, but is it safe to always assume pathname will start with a / here?

If not, may be a good spot for a regex that only strips the first character if it's a /

Copy link
Member Author

Choose a reason for hiding this comment

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

yea, agreed. better safe than sorry

@FredKSchott FredKSchott merged commit 81e210e into main Apr 13, 2022
@FredKSchott FredKSchott deleted the fix-base-build-bug branch April 13, 2022 02:54
@github-actions github-actions bot mentioned this pull request Apr 13, 2022
SiriousHunter pushed a commit to SiriousHunter/astro that referenced this pull request Feb 3, 2023
* fix ssr url search params bug

* fix build base bug

* safer slash removal
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.

🐛 BUG: build is not respecting "base" in Astro.request.url
2 participants