Websites/lib/middleware/dev_host.rb

17 lines
290 B
Ruby
Raw Normal View History

2024-05-03 23:06:08 +00:00
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