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

Experimental rewriting of POST request does not work #11127

Closed
gersomvg opened this issue May 23, 2024 · 3 comments · Fixed by #11182
Closed

Experimental rewriting of POST request does not work #11127

gersomvg opened this issue May 23, 2024 · 3 comments · Fixed by #11182
Assignees
Labels
- P3: minor bug An edge case that only affects very specific usage (priority)

Comments

@gersomvg
Copy link

gersomvg commented May 23, 2024

Astro Info

Astro                    v4.8.4
Node                     v20.12.2
System                   macOS (arm64)
Package Manager          npm (this should be pnpm)
Output                   server
Adapter                  @astrojs/node
Integrations             @astrojs/tailwind

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

Not specific to a browser

Describe the Bug

Just trying out the new rewriting feature as this came just in time for a use case that I had. Question: is this supposed to work with a POST request?

Let's say you post an email field to /page-a, I want to rewrite to /page-b while keeping the FormData.

It currently does not work, as the rewrite results in a 404. Any ideas?

What's the expected result?

I'd expect /page-b to render and receive the email field in FormData

Link to Minimal Reproducible Example

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

@github-actions github-actions bot added the needs triage Issue needs to be triaged label May 23, 2024
@matthewp
Copy link
Contributor

matthewp commented May 30, 2024

I would expect it to as well, likely we are creating a new request without copy over the method and body. cc @ematipico

@matthewp matthewp added - P4: important Violate documented behavior or significantly impacts performance (priority) and removed needs triage Issue needs to be triaged labels May 30, 2024
@ematipico ematipico added - P3: minor bug An edge case that only affects very specific usage (priority) and removed - P4: important Violate documented behavior or significantly impacts performance (priority) labels May 30, 2024
@ematipico
Copy link
Member

Downgraded to P3, as it's not critical and it doesn't affect many users. Plus, it's experimental and bugs are expected.

@gersomvg
Copy link
Author

gersomvg commented Jun 6, 2024

Great work @ematipico 🙌🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P3: minor bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants