aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/middleware/static.rb
diff options
context:
space:
mode:
authorKir Shatrov <shatrov@me.com>2017-07-01 23:09:13 +0300
committerKir Shatrov <shatrov@me.com>2017-07-06 21:30:43 +0300
commitb3f3d49fd6b91c6573b3e10e3d00f65306638927 (patch)
treeb831a180c5fe686fc47d80f56e46f2e727fac1b5 /actionpack/lib/action_dispatch/middleware/static.rb
parent6f2b0eb44ab166f98f3bc4a3aa09d3b899e0fd62 (diff)
downloadrails-b3f3d49fd6b91c6573b3e10e3d00f65306638927.tar.gz
rails-b3f3d49fd6b91c6573b3e10e3d00f65306638927.tar.bz2
rails-b3f3d49fd6b91c6573b3e10e3d00f65306638927.zip
Prepare AP and AR to be frozen string friendly
Diffstat (limited to 'actionpack/lib/action_dispatch/middleware/static.rb')
-rw-r--r--actionpack/lib/action_dispatch/middleware/static.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/static.rb b/actionpack/lib/action_dispatch/middleware/static.rb
index fb99f13a1c..6f4a97da3e 100644
--- a/actionpack/lib/action_dispatch/middleware/static.rb
+++ b/actionpack/lib/action_dispatch/middleware/static.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
require "rack/utils"
require "active_support/core_ext/uri"
@@ -33,7 +34,7 @@ module ActionDispatch
paths = [path, "#{path}#{ext}", "#{path}/#{@index}#{ext}"]
if match = paths.detect { |p|
- path = File.join(@root, p.force_encoding(Encoding::UTF_8))
+ path = File.join(@root, p.dup.force_encoding(Encoding::UTF_8))
begin
File.file?(path) && File.readable?(path)
rescue SystemCallError