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
Derek Prior 4701a50b58
Deprecate controller level force_ssl
Today there are two common ways for Rails developers to force their
applications to communicate over HTTPS:

* `config.force_ssl` is a setting in environment configurations that
  enables the `ActionDispatch::SSL` middleware. With this middleware
  enabled, all HTTP communication to your application will be redirected
  to HTTPS. The middleware also takes care of other best practices by
  setting HSTS headers, upgrading all cookies to secure only, etc.
* The `force_ssl` controller method redirects HTTP requests to certain
  controllers to HTTPS.

As a consultant, I've seen many applications with misconfigured HTTPS
setups due to developers adding `force_ssl` to `ApplicationController`
and not enabling `config.force_ssl`. With this configuration, many
application requests can be served over HTTP such as assets, requests
that hit mounted engines, etc. In addition, because cookies are not
upgraded to secure only in this configuration and HSTS headers are not
set, it's possible for cookies that are meant to be secure to be sent
over HTTP.

The confusion between these two methods of forcing HTTPS is compounded
by the fact that they share an identical name. This makes finding
documentation on the "right" method confusing.

HTTPS throughout is quickly becomming table stakes for all web sites.
Sites are expected to operate over HTTPS for all communication,
sensitive or otherwise. Let's encourage use of the broader-reaching
`ActionDispatch::SSL` middleware and elminate this source of user
confusion. If, for some reason, applications need to expose certain
endpoints over HTTP they can do so by properly configuring
`config.ssl_options`.
2018-03-30 09:58:28 -04:00
..
api Deprecate controller level force_ssl 2018-03-30 09:58:28 -04:00
controller_fixtures
metal
mime
new_base
parameters Rails 6 requires Ruby 2.4.1+ 2018-02-17 15:34:57 -08:00
request
action_pack_assertions_test.rb Use assert_empty and assert_not_empty 2018-01-25 23:32:59 -05:00
base_test.rb Use assert_predicate and assert_not_predicate 2018-01-25 23:32:59 -05:00
caching_test.rb Use assert_empty and assert_not_empty 2018-01-25 23:32:59 -05:00
content_type_test.rb
default_url_options_with_before_action_test.rb
filters_test.rb Use assert_predicate and assert_not_predicate 2018-01-25 23:32:59 -05:00
flash_hash_test.rb Use assert_empty and assert_not_empty 2018-01-25 23:32:59 -05:00
flash_test.rb
force_ssl_test.rb Deprecate controller level force_ssl 2018-03-30 09:58:28 -04:00
form_builder_test.rb
helper_test.rb
http_basic_authentication_test.rb
http_digest_authentication_test.rb We should call methods with .method_name not ::method_name. 2018-02-22 00:54:40 +01:00
http_token_authentication_test.rb
integration_test.rb Use assert_empty and assert_not_empty 2018-01-25 23:32:59 -05:00
live_stream_test.rb
localized_templates_test.rb
log_subscriber_test.rb
metal_test.rb Change refute to assert_not 2018-01-25 23:32:58 -05:00
output_escaping_test.rb Use assert_predicate and assert_not_predicate 2018-01-25 23:32:59 -05:00
parameter_encoding_test.rb
params_wrapper_test.rb
permitted_params_test.rb
redirect_test.rb
render_js_test.rb
render_json_test.rb
render_test.rb Use assert_predicate and assert_not_predicate 2018-01-25 23:32:59 -05:00
render_xml_test.rb
renderer_test.rb
renderers_test.rb
request_forgery_protection_test.rb Use assert_predicate and assert_not_predicate 2018-01-25 23:32:59 -05:00
required_params_test.rb
rescue_test.rb
resources_test.rb
routing_test.rb Ruby 2.4: take advantage of String#unpack1 2018-03-01 22:42:51 -08:00
runner_test.rb Use respond_to test helpers 2018-01-25 23:32:58 -05:00
send_file_test.rb
show_exceptions_test.rb
streaming_test.rb
test_case_test.rb Use assert_predicate and assert_not_predicate 2018-01-25 23:32:59 -05:00
url_for_integration_test.rb
url_for_test.rb Use respond_to test helpers 2018-01-25 23:32:58 -05:00
url_rewriter_test.rb
webservice_test.rb