calculate page hash only if response code is valid

This commit is contained in:
dctabuyz
2015-01-06 19:11:57 +03:00
parent b81a4987d9
commit 265bfcd7c8

View File

@@ -23,9 +23,9 @@ class WpTarget < WebSite
# @return [ Boolean ]
def default_wp_content_dir_exists?
response = Browser.get(@uri.merge('wp-content').to_s)
hash = Digest::MD5.hexdigest(response.body)
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
end