about summary refs log tree commit homepage
path: root/extras/try_gzip_static.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2013-12-30 02:02:21 +0000
committerEric Wong <e@80x24.org>2013-12-30 02:03:36 +0000
commit5535a4e78637c35081d42bf949e3995997ceefcb (patch)
treef5d15859ee12099e697ac1a751aea31305afb2e6 /extras/try_gzip_static.rb
parent4fe625b9a42b003e31329edd45d087b9c47ef5ed (diff)
downloadyahns-5535a4e78637c35081d42bf949e3995997ceefcb.tar.gz
Proper POSIX filesystems are encoding-agnostic.
Diffstat (limited to 'extras/try_gzip_static.rb')
-rw-r--r--extras/try_gzip_static.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/extras/try_gzip_static.rb b/extras/try_gzip_static.rb
index b8abb03..d562957 100644
--- a/extras/try_gzip_static.rb
+++ b/extras/try_gzip_static.rb
@@ -33,12 +33,12 @@ class TryGzipStatic
   end
 
   def initialize(root, default_type = 'text/plain')
-    @root = root
+    @root = root.b
     @default_type = default_type
   end
 
   def fspath(env)
-    path_info = Rack::Utils.unescape(env["PATH_INFO"])
+    path_info = Rack::Utils.unescape(env["PATH_INFO"], Encoding::BINARY)
     path_info =~ /\.\./ ? nil : "#@root#{path_info}"
   end