diff --git a/src/PrerenderMiddleware.php b/src/PrerenderMiddleware.php index 04f6ac5..0a12772 100644 --- a/src/PrerenderMiddleware.php +++ b/src/PrerenderMiddleware.php @@ -199,14 +199,18 @@ private function getPrerenderedPageResponse($request) $protocol = $request->isSecure() ? 'https' : 'http'; try { + // Return the Guzzle Response - $host = $request->getHost(); + $host = $request->getHost(); $path = $request->Path(); + // Fix "//" 404 error if ($path == "/") { $path = ""; } - return $this->client->get($this->prerenderUri . '/' . urlencode($protocol.'://'.$host.'/'.$path), compact('headers')); + + return $this->client->get($this->prerenderUri . '/' . urlencode($protocol.'://'.$host.'/'.$path.'?'.$request->getQueryString()), compact('headers')); + } catch (RequestException $exception) { if(!$this->returnSoftHttpCodes && !empty($exception->getResponse()) && $exception->getResponse()->getStatusCode() == 404) { \App::abort(404);