Fixed bug in serving static files from the demos directory.

This commit is contained in:
antisnatchor
2015-06-09 11:39:07 +02:00
parent 4746829153
commit f66a08f072

View File

@@ -15,6 +15,9 @@ module Demos
# mount everything in html directory to /demos/
path = File.dirname(__FILE__)+'/html/'
files = Dir[path+'**/*']
beef_server.mount('/demos', Rack::File.new(path))
files.each do |f|
# don't follow symlinks
next if File.symlink?(f)
@@ -22,8 +25,6 @@ module Demos
if File.extname(f) == '.html'
# use handler to mount HTML templates
beef_server.mount(mount_path, BeEF::Extension::Demos::Handler.new(f))
else
beef_server.mount(mount_path, Rack::File.new(f))
end
end
end