rails/rails — pull request #7307 by ey-pairing (2012-08-09 23:39:17+00:00)
Title: More useful Rails.application.routes.url_helpers

Right now if you include url_helpers the host, port and scheme aren't
set which gives you an exception or the wrong url when included in
places other than controller and views (where we have access to the
request). This adds that missing information in Thread.current via
a middleware and thus allows access which works.

What do you think? Wanted to get opinions before I dig into figuring out how to add a middleware to the default stack (and test that it's in the default stack).