Websites/lib/middleware/dev_host.rb

17 lines
290 B
Ruby

module Middleware
class DevHost
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
end