mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: don't block api requests when whitelisted_crawler_user_agents is set
This commit is contained in:
@@ -26,6 +26,8 @@ module Middleware
|
||||
!@request.xhr? &&
|
||||
!@request.path.ends_with?('robots.txt') &&
|
||||
!@request.path.ends_with?('srv/status') &&
|
||||
@request[Auth::DefaultCurrentUserProvider::API_KEY].nil? &&
|
||||
@env[Auth::DefaultCurrentUserProvider::USER_API_KEY].nil? &&
|
||||
CrawlerDetection.is_blocked_crawler?(@request.env['HTTP_USER_AGENT'])
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user