aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/fixtures/public
Commit message (Collapse)AuthorAgeFilesLines
* config.static_index configures directory index "index.html" filenameEliot Sykes2015-05-282-0/+2
| | | | | | Set `config.static_index` to serve a static directory index file not named `index`. For example, to serve `main.html` instead of `index.html` for directory requests, set `config.static_index` to `"main"`.
* Refactor out Dir.glob from ActionDispatch::Staticschneems2014-08-272-0/+2
| | | | | | | | 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.
* Address comments on Gzip implementationschneems2014-08-242-0/+4
| | | | | | | | | | | | | | | - don't mutate PATH_INFO in env, test - test fallback content type matches Rack::File - change assertion style - make HTTP_ACCEPT_ENCODING comparison case insensitive - return gzip path from method instead of true/false so we don't have to assume later - don't allocate un-needed hash. Original comments: https://github.com/rails/rails/commit/ cfaaacd9763642e91761de54c90669a88d772e5a#commitcomment-7468728 cc @jeremy
* Enable gzip compression by defaultschneems2014-08-202-0/+4
| | | | | | If someone is using ActionDispatch::Static to serve assets and makes it past the `match?` then the file exists on disk and it will be served. This PR adds in logic that checks to see if the file being served is already compressed (via gzip) and on disk, if it is it will be served as long as the client can handle gzip encoding. If not, then a non gzip file will be served. This additional logic slows down an individual asset request but should speed up the consumer experience as compressed files are served and production applications should be delivered with a CDN. This PR allows a CDN to cache a gzip file by setting the `Vary` header appropriately. In net this should speed up a production application that are using Rails as an origin for a CDN. Non-asset request speed is not affected in this PR.
* Remove unneeded test fixtures in AVPiotr Sarnacki2013-06-2018-18/+0
|
* Merge pull request #9857 from yyyc514/bad_params_should_400Aaron Patterson2013-04-301-0/+1
|\ | | | | failure to parse params should trigger a 400 Bad Request
| * failure to parse params should trigger a 400 Bad RequestJosh Goebel2013-03-211-0/+1
| |
* | Getting rid of a few other vestiges of rails.png.Steve Klabnik2013-04-021-0/+0
|/ | | | | | | | | | We don't actually need a rails.png in the AP fixtures, the tests that use it don't actually try to load the file. We also don't need to get rid of it with the dummy reset either. Finally, it's not needed in the sample application that's included with the Rails Guides.
* Respect absolute paths in compute_source_path.Steve Klabnik2012-06-161-0/+3
| | | | | | | | | | | | | | | | When using compute_source_path to determine the full path of an asset, if our source begins with '/', we don't want to include the directory. Examples are illustrative: > compute_source_path("foo", "stylesheets", "css") => "/Users/steve/src/my_app/public/stylesheets/foo.css" > compute_source_path("/foo", "stylesheets", "css") => "/Users/steve/src/my_app/public/foo.css" Before this patch, the second example would return the same as the first. Fixes #5680.
* Remove fixture files with Windows incompatible filenamesAndrew White2012-02-2012-12/+0
| | | | | | Windows doesn't allow `\ / : * ? " < > |` in filenames so create the fixture files at runtime and ignore the incompatible ones when running on Windows.
* Fix ActionDispatch::Static to serve files with unencoded PCHARAndrew White2012-02-1712-1/+12
| | | | | | | | | | | RFC 3986[1] allows sub-delim characters in path segments unencoded, however Rack::File requires them to be encoded so we use URI's unescape method to leave them alone and then escape them again. Also since the path gets passed to Dir[] we need to escape any glob characters in the path. [1]: http://www.ietf.org/rfc/rfc3986.txt
* escape static file path to prevent double unescapingSergey Nartimov2012-02-161-0/+1
|
* Add testcase for non english filename. Related to #2982.kennyj2012-02-051-0/+1
|
* Move Rails::Static into ActionDispatchJoshua Peek2009-09-263-0/+3
|
* Ignore everything under test/fixtures/public/absolutePratik Naik2009-07-271-1/+1
|
* Handle missing javascript/stylesheets assets by raising an exceptionChristos Zisopoulos2009-06-264-0/+4
| | | | | | | | | | | | An exception will be raised if a local javascript/stylesheet file included by the stylesheet_link_tag or javascript_include_tag can not be found. When caching is enabled, we use atomic_write to ensure that the cache file is not created with zero length. Signed-off-by: Michael Koziarski <michael@koziarski.com> [#2738 state:committed]
* ignore absolute tmp directoryJoshua Peek2009-06-251-0/+1
|
* Added localized rescue (404.da.html) [#1835 state:committed]José Valim2009-02-021-0/+1
| | | | Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
* Add :recursive option to javascript_include_tag and stylesheet_link_tag to ↵Damian Janowski2008-07-082-0/+2
| | | | | | be used along with :all. [#480 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Scripts and styles with multiple dots in the filename should cacheStephen Celis2008-04-122-0/+2
|
* Missed adds. References #10350.Jeremy Kemper2008-03-204-0/+4
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9066 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Re-added ActionView::Helpers::register_javascript/stylesheet_expansion to ↵Jeremy Kemper2008-03-201-0/+1
| | | | | | make it easier for plugin developers to inject multiple assets. Closes #10350. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9065 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added caching option to AssetTagHelper#stylesheet_link_tag and ↵David Heinemeier Hansson2007-02-184-0/+4
| | | | | | AssetTagHelper#javascript_include_tag [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6164 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* test javascript include with and without application.jsJeremy Kemper2007-01-081-0/+0
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5875 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* test controller rescuesJeremy Kemper2006-11-132-0/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5504 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added automated timestamping to AssetTagHelper methods for stylesheets, ↵David Heinemeier Hansson2006-03-291-0/+0
javascripts, and images when Action Controller is run under Rails [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4098 5ecf4fe2-1ee6-0310-87b1-e25e094e27de