lib/cms_scanner/errors/http.rb in cms_scanner-0.0.41.4 vs lib/cms_scanner/errors/http.rb in cms_scanner-0.0.41.5
- old
+ new
@@ -33,15 +33,25 @@
# :nocov:
end
# Access Forbidden Error
class AccessForbiddenError < Error
- # :nocov:
+ attr_reader :random_user_agent_used
+
+ # @param [ Boolean ] random_user_agent_used
+ def initialize(random_user_agent_used)
+ @random_user_agent_used = random_user_agent_used
+ end
+
def to_s
- 'The target is responding with a 403, this might be due to a WAF. ' \
- 'Please re-try with --random-user-agent'
+ msg = if random_user_agent_used
+ 'Well... --random-user-agent didn\'t work, you\'re on your own now!'
+ else
+ 'Please re-try with --random-user-agent'
+ end
+
+ "The target is responding with a 403, this might be due to a WAF. #{msg}"
end
- # :nocov:
end
# HTTP Redirect Error
class HTTPRedirectError < Error
attr_reader :redirect_uri