FIX: use crawler layout when saving url in Wayback Machine (#7667)

This commit is contained in:
Maja Komel
2019-06-03 04:13:32 +02:00
committed by Sam
parent 28dcf445b7
commit 42809f4d69
5 changed files with 50 additions and 39 deletions

View File

@ -62,7 +62,7 @@ module Middleware
@is_crawler ||=
begin
user_agent = @env[USER_AGENT]
if CrawlerDetection.crawler?(user_agent)
if CrawlerDetection.crawler?(user_agent, @env["HTTP_VIA"])
:true
else
user_agent.downcase.include?("discourse") ? :true : :false