Skip to content

Commit

Permalink
Merge pull request #20 from WilliamBlais/patch-1
Browse files Browse the repository at this point in the history
Fix "//" 404 error
  • Loading branch information
jeroennoten committed Apr 10, 2018
2 parents 607495d + 3ed4cd8 commit cb51eae
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 cb51eae

Please sign in to comment.