Skip to content

Commit

Permalink
fix: rename $user_agent into $user_agent_str
Browse files Browse the repository at this point in the history
$user_agent is already used, perl error
  • Loading branch information
raphael0202 committed Aug 8, 2023
1 parent 3df8eb9 commit 01cd1bf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/ProductOpener/Display.pm
Original file line number Diff line number Diff line change
Expand Up @@ -916,11 +916,11 @@ Set two attributes to `request_ref`:
=cut

sub set_user_agent_request_ref_attributes ($request_ref) {
my $user_agent = user_agent();
$request_ref->{user_agent} = $user_agent;
my $user_agent_str = user_agent();
$request_ref->{user_agent} = $user_agent_str;

my $is_crawl_bot = 0;
if ($user_agent
if ($user_agent_str
=~ /Googlebot|Googlebot-Image|Google-InspectionTool|bingbot|Applebot|YandexBot|YandexRenderResourcesBot|DuckDuckBot|DotBot|SeekportBot|AhrefsBot|DataForSeoBot|SeznamBot|ZoomBot|MojeekBot|QRbot|www\.qwant\.com|facebookexternalhit/
)
{
Expand Down

0 comments on commit 01cd1bf

Please sign in to comment.