Movatterモバイル変換


[0]ホーム

URL:


  1. Home
  2. Reference documentation
  3. VCL reference
  4. Variables in VCL
  5. Client request

client.bot.name

STRING, read-only.

Available inall subroutines.

Where the client is identifying itself as a known bot, this variable is set to the name of the bot (e.g., "Googlebot") claiming to be making the request.

TheUser-Agent header, which is used to infer the name of the bot, may be set arbitrarily in the request headers from a client. Some bots may therefore choose to send aUser-Agent header that identifies them as a different, better known bot in order to evade or intentionally trigger logic that is intended to apply to that kind of bot. In setting the value ofclient.bot.name, Fastly makes no attempt to verify the claims being made by the requesting client.

However, it is possible to use other aspects about a HTTP request - in particular the network from which the client IP is allocated, in order to better verify the authenticity of a bot's identity. For example, a client legitimately claiming to be Googlebot will only ever make requestsfrom Google's network, and you could write VCL code to validate this:

if (client.bot.name=="Googlebot"&&client.as.name=="google llc") {
# The client *claims* to be Googlebot and the client IP belongs to Google
...
}

Fastly providesGeolocation data for IPs, including whichautonomous system an IP is registered to. You can use this in conjunction with theclient.bot.name variable to confirm that the IP is in fact one of the IP ranges registered to Google:


[8]ページ先頭

©2009-2025 Movatter.jp