calculate page hash only if response code is valid
This commit is contained in:
@@ -23,9 +23,9 @@ class WpTarget < WebSite
|
|||||||
# @return [ Boolean ]
|
# @return [ Boolean ]
|
||||||
def default_wp_content_dir_exists?
|
def default_wp_content_dir_exists?
|
||||||
response = Browser.get(@uri.merge('wp-content').to_s)
|
response = Browser.get(@uri.merge('wp-content').to_s)
|
||||||
hash = Digest::MD5.hexdigest(response.body)
|
|
||||||
|
|
||||||
if WpTarget.valid_response_codes.include?(response.code)
|
if WpTarget.valid_response_codes.include?(response.code)
|
||||||
|
hash = Digest::MD5.hexdigest(response.body)
|
||||||
return true if hash != error_404_hash and hash != homepage_hash
|
return true if hash != error_404_hash and hash != homepage_hash
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user