method
handle_file
v2.3.8 -
Show latest stable
-
0 notes -
Class: DispatchServlet
- 1.0.0
- 1.1.6
- 1.2.6
- 2.0.3
- 2.1.0 (0)
- 2.2.1 (0)
- 2.3.8 (0)
- 3.0.0
- 3.0.9
- 3.1.0
- 3.2.1
- 3.2.8
- 3.2.13
- 4.0.2
- 4.1.8
- 4.2.1
- 4.2.7
- 4.2.9
- 5.0.0.1
- 5.1.7
- 5.2.3
- 6.0.0
- 6.1.3.1
- 6.1.7.7
- 7.0.0
- 7.1.3.2
- What's this?
handle_file(req, res)
public
Hide source
# File railties/lib/webrick_server.rb, line 80 def handle_file(req, res) #:nodoc: begin req = req.dup path = req.path.dup # Add .html if the last path piece has no . in it path << '.html' if path != '/' && (%r{(^|/)[^./]+$} =~ path) path.gsub!('+', ' ') # Unescape + since FileHandler doesn't do so. req.instance_variable_set(:@path_info, path) # Set the modified path... @file_handler.send(:service, req, res) return true rescue HTTPStatus::PartialContent, HTTPStatus::NotModified => err res.set_error(err) return true rescue => err return false end end