[PATCH] ActionController request domain/subdomains bug (Ticket 9479)

10 views
Skip to first unread message

Jim Meyer

unread,
Nov 6, 2007, 10:42:55 PM11/6/07
to Ruby on Rails: Core
A while back I tripped over a case where ActionController flakes when
handed a dotted-quad hostname behaves oddly; it (properly) asserts
that the domain name is nil, but happily tells you the subdomains are
the first two quads. Like so:

> console
>> @request = ActionController::TestRequest.new
=> #<ActionController::TestRequest:0x38a2868 ...>
>> @request.host = '192.168.1.1'
=> "192.168.1.1"
>> @request.domain
=> nil
>> @request.subdomains
=> ["192", "168"]

When patched, @request.subdomains returns an empty array.

Ticket and patch (with tests): http://dev.rubyonrails.org/ticket/9479

Could I beg a quick review and, if worthy, a few +1s to get this into
Rails 2?

Thanks!

--j

DHH

unread,
Nov 7, 2007, 9:58:06 AM11/7/07
to Ruby on Rails: Core
> Could I beg a quick review and, if worthy, a few +1s to get this into
> Rails 2?

Good stuff. Applied.

Reply all
Reply to author
Forward
0 new messages