Fixed middleware customization so that it doesn't assume the presence or
location of ActionDispatch::Static.