git-svn-id: https://beef.googlecode.com/svn/trunk@503 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9
21 lines
636 B
Ruby
21 lines
636 B
Ruby
module BeEF
|
|
|
|
class PublicHandler < WEBrick::HTTPServlet::FileHandler
|
|
|
|
def do_GET(req, res)
|
|
super
|
|
|
|
# set content types
|
|
res.header['content-type']='text/html' # default content type for all pages
|
|
res.header['content-type']='text/javascript' if req.path =~ /.json$/
|
|
res.header['content-type']='text/javascript' if req.path =~ /.js$/
|
|
res.header['content-type']='text/css' if req.path =~ /.css$/
|
|
res.header['content-type']='image/png' if req.path =~ /.png$/
|
|
res.header['content-type']='image/gif' if req.path =~ /.gif$/
|
|
res.header['content-type']='text/xml' if req.path =~ /.xml$/
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end |