inertiajs / inertia-laravel

The Laravel adapter for Inertia.js.
https://inertiajs.com
MIT License
1.99k stars 222 forks source link

Inertiajs ignoring methods, when the request is redirected. #251

Open hicham-saddek opened 3 years ago

hicham-saddek commented 3 years ago

Problem

The request that is made for the Laravel Application, is being redirected as part of the application main logic, but inertiajs methods seems to be lost in the request body, i have to replace the _METHOD of the post request to the content of the header REDIRECT_REDIRECT_REQUEST_METHOD each time as the REQUEST_METHOD is not provided by inertia.

How to fix

I use a seprate middleware for the moment, but it will be much apreciated if we can check inside the main Inertia Middleware, to confirm the right method.

Solution

inertia-middleware-ignoring-methods

I will also be working to provide a PR for this issue.

crnkovic commented 1 year ago

@hicham-saddek can you still replicate this? I have never encountered this myself. Please close the issue if this is no longer relevant and/or has been solved.

hicham-saddek commented 1 year ago

@crnkovic, I am still able to reproduce this error, the steps are in the PR request available here PR

AntonOfTheWoods commented 8 months ago

@crnkovic , @reinink - it looks like I'm getting this too, and no one seems to have even bothered to look at the PR. Am I missing something?