Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Server returns 301 for server actions with config trailingComa: "always" in preview mode #464

Description

@darkmaga

Astro Info

Astro                    v4.16.16
Node                     v22.6.0
System                   macOS (arm64)
Package Manager          npm
Output                   hybrid
Adapter                  @astrojs/node
Integrations             none

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

Im trying to npm run preview my app with server actions in the client script tag. I have trailingSlash: "always" seted in my config and the problem is when i try to invoke action, node createStaticHandler doesnt pass any url without / at the end and returning 301 for this request.

Request examples with trailingSlash: "always":

Снимок экрана 2024-11-29 в 20 59 50
Снимок экрана 2024-11-29 в 21 00 39

If i remove trailingSlash: "always" actions works fine

Request examples without trailingSlash: "always":

Снимок экрана 2024-11-29 в 21 03 48

What's the expected result?

Not to get this behavior

Link to Minimal Reproducible Example

https://stackblitz.com/edit/withastro-astro-mmkpqs?file=src%2Fpages%2Findex.astro

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    pkg: nodeRelated to Node adapter (scope)

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions