lib/cms_scanner/target/platform/php.rb in cms_scanner-0.0.41.10 vs lib/cms_scanner/target/platform/php.rb in cms_scanner-0.0.42.0

- old
+ new

@@ -1,5 +1,7 @@ +# frozen_string_literal: true + module CMSScanner class Target < WebSite module Platform # Some PHP specific implementation module PHP @@ -12,12 +14,12 @@ # @param [ Regexp ] pattern # @param [ Hash ] params The request params # # @return [ Boolean ] def log_file?(path, pattern, params = {}) - # Only the first 700 bytes of the file are retrieved to avoid getting enture log file + # Only the first 700 bytes of the file are retrieved to avoid getting entire log file # which can be huge (~ 2Go) - res = NS::Browser.get(url(path), params.merge(headers: { 'range' => 'bytes=0-700' })) + res = head_and_get(path, [200], get: params.merge(headers: { 'Range' => 'bytes=0-700' })) res.body =~ pattern ? true : false end # @param [ String ] path