1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionpack/test/controller/new_base
John Hawthorn eb52904eb5 Always reject files external to app
Previously, when using `render file:`, it was possible to render files
not only at an absolute path or relative to the current directory, but
relative to ANY view paths. This was probably done for absolutely
maximum compatibility when addressing CVE-2016-0752, but I think is
unlikely to be used in practice.

Tihs commit removes the ability to `render file:` with a path relative
to a non-fallback view path.

Make FallbackResolver.new private

To ensure nobody is making FallbackResolvers other than "/" and "".

Make reject_files_external_... no-op for fallbacks

Because there are only two values used for path: "" and "/", and
File.join("", "") == File.join("/", "") == "/", this method was only
testing that the absolute paths started at "/" (which of course all do).

This commit doesn't change any behaviour, but it makes it explicit that
the FallbackFileSystemResolver works this way.

Remove outside_app_allowed argument

Deprecate find_all_anywhere

This is now equivalent to find_all

Remove outside_app argument

Deprecate find_file for find

Both LookupContext#find_file and PathSet#find_file are now equivalent to
their respective #find methods.
2019-04-03 09:02:28 -07:00
..
bare_metal_test.rb Enable Performance/UnfreezeString cop 2018-09-23 08:56:55 +09:00
base_test.rb Remove :api: tag that has leaked on the doc directly [ci skip] 2017-09-30 18:42:46 +09:00
content_negotiation_test.rb Address rubocop offences 2019-03-21 11:19:47 +09:00
content_type_test.rb Use frozen string literal in actionpack/ 2017-07-29 14:02:40 +03:00
middleware_test.rb Make actionpack frozen string friendly 2017-07-24 23:38:04 +03:00
render_action_test.rb Use frozen string literal in actionpack/ 2017-07-29 14:02:40 +03:00
render_body_test.rb Use frozen string literal in actionpack/ 2017-07-29 14:02:40 +03:00
render_file_test.rb Always reject files external to app 2019-04-03 09:02:28 -07:00
render_html_test.rb Use frozen string literal in actionpack/ 2017-07-29 14:02:40 +03:00
render_implicit_action_test.rb Use frozen string literal in actionpack/ 2017-07-29 14:02:40 +03:00
render_layout_test.rb Use frozen string literal in actionpack/ 2017-07-29 14:02:40 +03:00
render_partial_test.rb Use frozen string literal in actionpack/ 2017-07-29 14:02:40 +03:00
render_plain_test.rb Use frozen string literal in actionpack/ 2017-07-29 14:02:40 +03:00
render_streaming_test.rb Use frozen string literal in actionpack/ 2017-07-29 14:02:40 +03:00
render_template_test.rb Use frozen string literal in actionpack/ 2017-07-29 14:02:40 +03:00
render_test.rb Use frozen string literal in actionpack/ 2017-07-29 14:02:40 +03:00
render_xml_test.rb Use frozen string literal in actionpack/ 2017-07-29 14:02:40 +03:00