I am struggling from 2 days to solve the issue with my Laravel app which I have uploaded on Heroku server. This application is uploading a file through ajax request showing upload progress also on the page and it returns json response.
I have set the Content-Type: application/json
and X-CSRF-TOKEN
is also valid in the header but still after completing the upload instead of returning valid json response, it setting status to 301 and 302 and move to home page.
I have tested this Laravel app on my local server and its very stable there. I am thinking if there is any way to pause chrome before loading the redirection page by hitting a breakpoint, so I could know whats happening before the redirection. I have already tried this in console:
window.addEventListener("beforeunload", function() { debugger; }, false)
but it never trigger a breakpoint. Any help will be appreciated.