Class: Geminabox::Proxy::Hostess

Inherits:
Sinatra::Base
  • Object
show all
Defined in:
lib/geminabox/proxy/hostess.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#file_handlerObject

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

#serveObject



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.expand_path(File.join(Geminabox.data, *request.path_info)), :type => response['Content-Type'])
  end
end