Skip to content

Commit

Permalink
Made Tiktok block case insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
LauraWebdev committed Dec 31, 2023
1 parent 7e90b51 commit aca7c83
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Listener/ApiLogListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function onKernelRequest(RequestEvent $event): void
{
$request = $event->getRequest();

if(str_contains($request->headers->get('User-Agent'), "Byte")) {
if(str_contains(strtolower($request->headers->get('User-Agent')), "byte")) {
$event->setResponse(new Response('Access via Bytespider (TikTok/Bytedance bot) is blocked.', Response::HTTP_FORBIDDEN));
return;
}
Expand Down

0 comments on commit aca7c83

Please sign in to comment.