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
schneems 334549b4a5 Fix improperly configured host in generated urls
If the host in `default_url_options` is accidentally set with a protocol such as 

```
host: "http://example.com"
``` 

then the generated url will have the protocol twice `http://http://example.com` which is not what the user intended. Likely they wanted to define a host `host: "example.com"` and a `protocol: "http://"` but did not know the convention.

This may not the most common problem, but when it happens it can go undetected for a while. I accidentally added `http://` out of habit recently only to find all the links in my emails were broken after deploying a demo site to production. Rather than allow this accident go undetected, we can fix the problem in line by properly setting the protocol and host.


I was able to find this related question on stack overflow: http://stackoverflow.com/questions/5878329/rails-3-devise-how-do-i-make-the-email-confirmation-links-use-secure-https-n where the answer was highly upvoted.

This is based off of work in #7415 cc/ @pixeltrix

ATP Action Mailer and Action Pack
2013-03-19 12:34:49 -05:00
..
abstract Fix setting expected value in translation tests 2013-01-21 09:29:03 -02:00
activerecord fix db_runtime attribute value after raising ActionView::MissingTemplate exception 2013-02-27 16:35:22 +02:00
assertions
controller Digest auth should not 500 when given a basic header. 2013-03-18 14:50:47 -04:00
dispatch Fix improperly configured host in generated urls 2013-03-19 12:34:49 -05:00
fixtures UTF-8 encode all keys and values in nested params hash. 2013-03-15 09:17:03 +08:00
journey Make ActionDispatch::Journey::Path::Pattern#new raise more meaningful exception message. 2013-02-27 08:26:51 +08:00
lib/controller
routing
template Merge branch 'master-sec' 2013-03-18 10:17:32 -07:00
tmp
abstract_unit.rb Set Thread.abort_on_exception for the whole AS, AP, and AR tests 2013-01-24 20:00:45 +09:00
active_record_unit.rb
ts_isolated.rb