Class: My::StaticPage
- Inherits:
-
Action
- Object
- K8::BaseAction
- K8::Action
- Action
- My::StaticPage
- Defined in:
- lib/keight/skeleton/app/action.rb
Constant Summary collapse
- STATIC_DIR =
"static"
Constants inherited from Action
Action::ERUBY_CACHE, Action::ERUBY_HTML, Action::ERUBY_HTML_EXT, Action::ERUBY_LAYOUT, Action::ERUBY_PATH, Action::ERUBY_TEXT, Action::ERUBY_TEXT_EXT
Instance Attribute Summary
Attributes inherited from K8::BaseAction
Instance Method Summary collapse
Methods inherited from K8::BaseAction
Constructor Details
This class inherits a constructor from K8::BaseAction
Instance Method Details
#do_send_file(urlpath) ⇒ Object
93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/keight/skeleton/app/action.rb', line 93 def do_send_file(urlpath) filepath = "#{STATIC_DIR}/#{urlpath}" File.file?(filepath) or raise K8::HttpException.new(404) #env = @req.env #header_name = env['sendfile.type'] || env['HTTP_X_SENDFILE_TYPE'] #if header_name && ! header_name.empty? # @resp.headers[header_name] = filepath # return nil #else return send_file(filepath) #end end |