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

[1.x] Updating response status code to prevent method not allowed #456

Merged
merged 1 commit into from
Nov 16, 2020

Conversation

parsingeye
Copy link
Contributor

Return back with 303 when requesting with DELETE and PUT to prevent 405 on the subsequent request.
back() returns 302 by default.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/303
https://inertiajs.com/redirects

Return back with 303 to prevent 405 on the next request
@taylorotwell
Copy link
Member

taylorotwell commented Nov 15, 2020

Per Inertia documentation:

If you're using one of our official server-side adapters, redirects will automatically be converted.

Jonathan Reinink told me a week or two ago that manually returning 303 is not needed anymore when using the Inertia server side adapter. Are you actually having a problem because of this.

@driesvints driesvints changed the title Updating response status code to prevent method not allowed [1.x] Updating response status code to prevent method not allowed Nov 16, 2020
@parsingeye
Copy link
Contributor Author

That's true, now I see that redirects are converted in the code https://github.com/inertiajs/inertia-laravel/blob/master/src/Middleware.php#L121
For some reason, it still didn't work for me. I'm gonna dig a bit deeper into this.

@taylorotwell
Copy link
Member

I don't mind adding them here.

@taylorotwell taylorotwell merged commit f053c5f into laravel:1.x Nov 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants