From e188eac55de792eb71946ece65c33464a9e64093 Mon Sep 17 00:00:00 2001 From: Jamie Gaskins Date: Wed, 8 Dec 2021 12:32:04 -0500 Subject: [PATCH] Fix Fastly bot block for Ruby `Net::HTTP` clients (#15713) I was using the wrong VCL request property. It's `req.url`, not `req.http.url`. https://developer.fastly.com/reference/vcl/variables/client-request/req-url/ --- config/fastly/snippets/bad_bot_detection.vcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/fastly/snippets/bad_bot_detection.vcl b/config/fastly/snippets/bad_bot_detection.vcl index 1c9d0dc01..1d419ac52 100644 --- a/config/fastly/snippets/bad_bot_detection.vcl +++ b/config/fastly/snippets/bad_bot_detection.vcl @@ -114,7 +114,7 @@ sub vcl_recv { || req.http.user-agent == "RSurf15a 51" || req.http.user-agent == "RSurf15a 81" # Block Ruby bots unless they're interacting with the API - || (req.http.user-agent == "Ruby" && !(req.http.url ~ "^/api")) + || (req.http.user-agent == "Ruby" && !(req.url ~ "^/api")) || req.http.user-agent == "searchbot admin@google.com" || req.http.user-agent == "ShablastBot 1.0" || req.http.user-agent == "snap.com beta crawler v0"