summaryrefslogtreecommitdiff
path: root/lib/webrick/httpservlet/filehandler.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/webrick/httpservlet/filehandler.rb')
-rw-r--r--lib/webrick/httpservlet/filehandler.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/webrick/httpservlet/filehandler.rb b/lib/webrick/httpservlet/filehandler.rb
index 601882ef4c..0072e81ac6 100644
--- a/lib/webrick/httpservlet/filehandler.rb
+++ b/lib/webrick/httpservlet/filehandler.rb
@@ -11,9 +11,9 @@
require 'time'
-require_relative '../htmlutils'
-require_relative '../httputils'
-require_relative '../httpstatus'
+require 'webrick/htmlutils'
+require 'webrick/httputils'
+require 'webrick/httpstatus'
module WEBrick
module HTTPServlet
@@ -55,7 +55,7 @@ module WEBrick
else
mtype = HTTPUtils::mime_type(@local_path, @config[:MimeTypes])
res['content-type'] = mtype
- res['content-length'] = st.size.to_s
+ res['content-length'] = st.size
res['last-modified'] = mtime.httpdate
res.body = File.open(@local_path, "rb")
end
@@ -144,7 +144,7 @@ module WEBrick
raise HTTPStatus::RequestRangeNotSatisfiable if first < 0
res['content-type'] = mtype
res['content-range'] = "bytes #{first}-#{last}/#{filesize}"
- res['content-length'] = (last - first + 1).to_s
+ res['content-length'] = last - first + 1
res.body = io.dup
else
raise HTTPStatus::BadRequest