Donovan Daniels
90c05547f6
This makes matching against routes later much more reliable and less complicated
15 lines
256 B
Ruby
15 lines
256 B
Ruby
class DevHostMiddleware
|
|
def initialize(app)
|
|
@app = app
|
|
end
|
|
|
|
def call(env)
|
|
request = Rack::Request.new(env)
|
|
domain = request.params["domain"]
|
|
|
|
env["HTTP_HOST"] = domain if Rails.env.development? && domain
|
|
|
|
@app.call(env)
|
|
end
|
|
end
|