Recent Posts
PAWN | 18 sec ago
Java | 21 sec ago
None | 32 sec ago
JavaScript | 38 sec ago
PHP | 59 sec ago
None | 1 min ago
None | 1 min ago
None | 1 min ago
None | 1 min ago
None | 1 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
By pedro mg on the 18th of Nov 2007 04:09:32 AM
Download |
Raw |
Embed |
Report
class Static < R '/static/(.+)'
MIME_TYPES = { '.css' => 'text/css', '.js' => 'text/javascript',
'.jpg' => 'image/jpeg', '.png' => 'image/png' }
def get(file)
@headers['Content-Type'] = MIME_TYPES[file[('/\.\w+$/')]] || 'text/plain'
unless file.include?".."
@headers['X-Sendfile'] = "#{File.expand_path(File.dirname(__FILE__))}/static/#{file}"
else
@status = "403"
"403 - Path Not Found!"
end
end
Submit a correction or amendment below.
Make A New Post