Skip to content

Commit

Permalink
Fix "//" 404 error
Browse files Browse the repository at this point in the history
  • Loading branch information
William Blais authored Apr 9, 2018
1 parent 607495d commit 3ed4cd8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/PrerenderMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,10 @@ private function getPrerenderedPageResponse($request)
// Return the Guzzle Response
$host = $request->getHost();
$path = $request->Path();
// Fix "//" 404 error
if ($path == "/") {
$path = "";
}
return $this->client->get($this->prerenderUri . '/' . urlencode($protocol.'://'.$host.'/'.$path), compact('headers'));
} catch (RequestException $exception) {
if(!$this->returnSoftHttpCodes && !empty($exception->getResponse()) && $exception->getResponse()->getStatusCode() == 404) {
Expand Down

0 comments on commit 3ed4cd8

Please sign in to comment.