I have found myself needing to know what, if any, the subdomain is in a request… from within a Rack middleware. I’d like to redirect, change the path, or set the
Current.locale based on that subdomain.
To my surprise every time, this doesn’t work.
Rack::Request.new(env).subdomain #=> 'en'
It’d be a lot cooler if it did.
Also, if this worked to handle multiple subdomains too.
Rack::Request.new(env).subdomains #=> ['del', 'icio']
Thanks for doing this May of WTFs! And for all the hard work that yall do on Rails, in general.