Class: Geminabox::Proxy::Hostess
- Inherits:
-
Sinatra::Base
- Object
- Sinatra::Base
- Geminabox::Proxy::Hostess
- Defined in:
- lib/geminabox/proxy/hostess.rb
Instance Attribute Summary collapse
-
#file_handler ⇒ Object
Returns the value of attribute file_handler.
Instance Method Summary collapse
Instance Attribute Details
#file_handler ⇒ Object
Returns the value of attribute file_handler.
9 10 11 |
# File 'lib/geminabox/proxy/hostess.rb', line 9 def file_handler @file_handler end |
Instance Method Details
#serve ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/geminabox/proxy/hostess.rb', line 10 def serve headers["Cache-Control"] = 'no-transform' if file_handler send_file file_handler.proxy_path else send_file(File.(File.join(Geminabox.data, *request.path_info)), :type => response['Content-Type']) end end |