Detect directory listing in upload folder

This commit is contained in:
Christian Mehlmauer
2014-09-05 18:25:46 +02:00
parent aa8e525681
commit 66cd3e08a0
3 changed files with 21 additions and 1 deletions

View File

@@ -232,3 +232,10 @@ def get_random_user_agent
# return ransom user-agent
user_agents.sample
end
# Directory listing enabled on url?
#
# @return [ Boolean ]
def directory_listing_enabled?(url)
Browser.get(url.to_s).body[%r{<title>Index of}] ? true : false
end