inertia-laravel icon indicating copy to clipboard operation
inertia-laravel copied to clipboard

Fixing methods getting ignored after redirect

Open hicham-saddek opened this issue 4 years ago • 1 comments

Subject

The inertia middleware ignores the methods comming from the vuejs to the laravel application, after they are redirected many times, they are all treated as GET methods.

How to reproduce

1- Fresh Laravel application with Jetstream installed. 2- If cPanel available, activated the automatic HTTP to HTTPS redirect. 3- Try activating the Two-Factor-Authentication via the Frontend.

Solution

Since the redirected method is actually ignored but is represented in the header REDIRECT_REDIRECT_REQUEST_METHOD as the redirect method, we can actually override the current method, with the redirect one if it's existing.

which we can find in $request->server('REDIRECT_REDIRECT_REQUEST_METHOD').

hicham-saddek avatar Apr 11 '21 19:04 hicham-saddek

@reinink any updates ?

hicham-saddek avatar Apr 18 '21 10:04 hicham-saddek

Heya. We removed our master branch. Feel free to re-attempt this to 1.x!

driesvints avatar May 15 '24 15:05 driesvints