Changeset 2270 introduced dotted-quad handling to ActionController::AbstractRequest#domain without adding it to ActionController::AbstractRequest#subdomains. Additionally, the regex used to match dotted-quad is unanchored, allowing some (admittedly bizarre) edge cases to slip through. For example:
# request.host == '127.0.0.1'
request.domain.nil? # => true
request.subdomains # => ["127", "0"]
Attached patch (vs. revision 7406) includes tests to demonstrate the defects and refactors both ActionController::AbstractRequest#domain and ActionController::AbstractRequest#subdomains to use a common method for determining whether or not they're dealing with a named host.