Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The middleware terminate method descripton is misleading.
From the current version you can think that something will be done on server side, when the browser will really receive the response. THIS IS NOT TRUE - if you will put e.g. sleep(10) in the terminate method - you will see in the browser that you will have to wait those additional 10second for the response from server to be done. I've checked this using php artisan serve and also by running it on Apache 2.4 with php 7.2 installed.
- Loading branch information
984d785
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, the previous version is true when i tested.
Using nginx 1.16.0 and php 7.1.29 in a Vagrant environment, not php artisan serve.
I put a 5 seconds sleep inside the terminate and added a log.
Made a request to the server via AJAX, got a JSON response from the server, after 5 seconds, my log was logged in the laravel log file.