Skip to content

Commit

Permalink
Mark ChatGPT as a search engine
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Dec 12, 2023
1 parent 095bb61 commit a4b93ae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Revision history for CGI-Info
Better arg count checking
Mark techiaith.cymru as a robot
Facebook FBCLID can have "--" which can cause false positives
Mark ChatGPT as a search engine

0.78 Fri Oct 6 13:59:51 EDT 2023
Set HTTP status to 403 on HTTP_USER_AGENT SQL injection attack
Expand Down
2 changes: 1 addition & 1 deletion lib/CGI/Info.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1532,7 +1532,7 @@ sub is_search_engine {
# TODO: DNS lookup, not gethostbyaddr - though that will be slow
my $hostname = gethostbyaddr(inet_aton($remote), AF_INET) || $remote;

if(defined($hostname) && ($hostname =~ /google|msnbot|bingbot|amazonbot/) && ($hostname !~ /^google-proxy/)) {
if(defined($hostname) && ($hostname =~ /google|msnbot|bingbot|amazonbot|GPTBot/) && ($hostname !~ /^google-proxy/)) {
if($self->{cache}) {
$self->{cache}->set($key, 'search', '1 day');
}
Expand Down

0 comments on commit a4b93ae

Please sign in to comment.