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: endpoints in dev server should never have trailing slash #10216

Closed
wants to merge 1 commit into from

Conversation

ematipico
Copy link
Member

Changes

Closes #10149

Testing

Added a new test case. It seems we didn't have one.

Docs

Copy link

changeset-bot bot commented Feb 23, 2024

🦋 Changeset detected

Latest commit: 4be7253

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 23, 2024
@ematipico ematipico force-pushed the fix/endpoint-dev-trailing-slash branch from e06619a to 6400c29 Compare February 23, 2024 14:14
@ematipico ematipico force-pushed the fix/endpoint-dev-trailing-slash branch from 6400c29 to 4be7253 Compare February 23, 2024 14:15
Copy link
Contributor

@lilnasy lilnasy left a comment

Choose a reason for hiding this comment

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

Assuming the changeset needs to be corrected, I think this is the wrong call.

Users should configure "trailingSlash" to inform the dev server that the production server will behave a certain way so it should too. If the behavior doesn't match, they may need to configure something else. trailingSlash is doing what the config is telling it to.

@matthewp
Copy link
Contributor

Hm, that's a good point, let's chat about it.

@lilnasy
Copy link
Contributor

lilnasy commented Feb 23, 2024

Test cases already exist in test/units/routing/trailing-slash.test.js, and check for the opposite behavior.

@ematipico ematipico closed this Feb 23, 2024
@kripod
Copy link

kripod commented Mar 2, 2024

I‘m afraid this issue still persists: #10149 (comment)

Static File Endpoints exposing e.g. .png assets for dynamic social image generation can‘t be accessed as /img.png in dev mode, because only /img.png/ would pass the overly strict trailing slash requirements.

@bluwy bluwy deleted the fix/endpoint-dev-trailing-slash branch October 8, 2024 06:23
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.

Static File Endpoints broken with trailingSlash: "always" in development
4 participants