Skip to content
This repository has been archived by the owner on May 25, 2022. It is now read-only.

Commit

Permalink
Enable only for crawlers
Browse files Browse the repository at this point in the history
  • Loading branch information
ovanschie committed Apr 15, 2018
1 parent 42a7dec commit 195bb83
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/Middleware/CrawlerPrerenderMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ public function handle($request, Closure $next, $guard = null)
{
$response = $next($request);

if (Crawler::isCrawler()) {
// true if crawler user agent detected
}

if ($this->hasPrerenderedView($request->getPathInfo())) {
if (Crawler::isCrawler() && $this->hasPrerenderedView($request->getPathInfo())) {
$response->setContent(
$this->getPrerenderedView($request->getPathInfo())
);
Expand Down

0 comments on commit 195bb83

Please sign in to comment.