aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/fixtures/公共
diff options
context:
space:
mode:
authorschneems <richard.schneeman@gmail.com>2014-08-18 11:20:06 -0500
committerschneems <richard.schneeman@gmail.com>2014-08-27 13:03:08 -0500
commit0b1a87f73cca3da23b65f3dfb19daeac436ab2ee (patch)
treea5e04e8b52c47c007dee4861c5f26383674ff9d7 /actionpack/test/fixtures/公共
parent5bcd5a32abf14b371424131dce819139de09c74c (diff)
downloadrails-0b1a87f73cca3da23b65f3dfb19daeac436ab2ee.tar.gz
rails-0b1a87f73cca3da23b65f3dfb19daeac436ab2ee.tar.bz2
rails-0b1a87f73cca3da23b65f3dfb19daeac436ab2ee.zip
Refactor out Dir.glob from ActionDispatch::Static
Dir.glob can be a security concern. The original use was to provide logic of fallback files. Example a request to `/` should render the file from `/public/index.html`. We can replace the dir glob with the specific logic it represents. The glob {,index,index.html} will look for the current path, then in the directory of the path with index file and then in the directory of the path with index.html. This PR replaces the glob logic by manually checking each potential match. Best case scenario this results in one less file API request, worst case, this has one more file API request. Related to #16464 Update: added a test for when a file of a given name (`public/bar.html` and a directory `public/bar` both exist in the same root directory. Changed logic to accommodate this scenario.
Diffstat (limited to 'actionpack/test/fixtures/公共')
-rw-r--r--actionpack/test/fixtures/公共/bar.html1
-rw-r--r--actionpack/test/fixtures/公共/bar/index.html1
2 files changed, 2 insertions, 0 deletions
diff --git a/actionpack/test/fixtures/公共/bar.html b/actionpack/test/fixtures/公共/bar.html
new file mode 100644
index 0000000000..67fc57079b
--- /dev/null
+++ b/actionpack/test/fixtures/公共/bar.html
@@ -0,0 +1 @@
+/bar.html \ No newline at end of file
diff --git a/actionpack/test/fixtures/公共/bar/index.html b/actionpack/test/fixtures/公共/bar/index.html
new file mode 100644
index 0000000000..d5bb8f898d
--- /dev/null
+++ b/actionpack/test/fixtures/公共/bar/index.html
@@ -0,0 +1 @@
+/bar/index.html \ No newline at end of file