Skip to content

Commit 65e8c9e

Browse files
committed
Make sure Dingo only terminates middlewares for API requests.
1 parent 9abeb4b commit 65e8c9e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Http/Middleware/Request.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,11 @@ protected function sendRequestThroughRouter(HttpRequest $request)
120120
*/
121121
public function terminate($request, $response)
122122
{
123-
$request = $this->app['request'];
123+
if (! ($request = $this->app['request']) instanceof HttpRequest) {
124+
return;
125+
}
126+
127+
\Log::info('dingo is terminating the route middleware');
124128

125129
// Laravel's route middlewares can be terminated just like application
126130
// middleware, so we'll gather all the route middleware here.

0 commit comments

Comments
 (0)