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

Bug: POST redirects with basepath wrong method. #2632

Open
marvinhagemeister opened this issue Aug 30, 2024 · 1 comment
Open

Bug: POST redirects with basepath wrong method. #2632

marvinhagemeister opened this issue Aug 30, 2024 · 1 comment
Labels
bug Something isn't working.

Comments

@marvinhagemeister
Copy link
Collaborator

From discord https://discord.com/channels/684898665143206084/991511118524715139/1279100135606849619

When using deno fresh alone with the basepath config parameter set (let's say "/basepath"), all requests made to "/" are redirect to "/basepath" with a 302 Found status (this is correct I think).
But when the request is a POST, the redirection is made with a GET, I think the init method is not reused.

@marvinhagemeister marvinhagemeister added the bug Something isn't working. label Aug 30, 2024
@jake-abed
Copy link

jake-abed commented Sep 9, 2024

Confirming that this bug still exists as of 1.7.1

Can be quickly verified by adding handlers.

Checking MDN's resources on temporary redirections, the source of the issue may be choosing to use a 302 instead of a 307:

302 - Found - GET methods unchanged. Others may or may not be changed to GET. [2]

307 - Temporary Redirect - Method and body not changed

I think the fix for this could be so simple as swapping the status code in Context. If this still isn't resolved this evening, I'd love to give it a shot and open up a PR.

Edit: Or is this even worth fixing? I think it may be fixed by Fresh 2.0 but need to sleuth more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working.
Projects
None yet
Development

No branches or pull requests

2 participants