Open kyranb opened 5 years ago
Is anyone else that's using this able to make valid xhr requests?
I needed to make the following change to this in order for it to work.
The Turbolinks class works fine without issue, but it seems that Laravel is overwriting the response body somewhere else.
https://github.com/helthe/Turbolinks/blob/master/StackTurbolinks.php#L49
public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true) { $response = $this->app->handle($request, $type, $catch); if (self::MASTER_REQUEST === $type) { $this->turbolinks->decorateResponse($request, $response); } if(str_contains($response->getContent(), 'Turbolinks')) { return response($response->getContent())->header('Content-Type', 'application/javascript'); }
Is anyone else that's using this able to make valid xhr requests?
I needed to make the following change to this in order for it to work.
The Turbolinks class works fine without issue, but it seems that Laravel is overwriting the response body somewhere else.
https://github.com/helthe/Turbolinks/blob/master/StackTurbolinks.php#L49