Sha256: e071a88a26d1a9404dcfe8a90410f229e77cf54a5c98a2c7ab02c049c80363f7
Contents?: true
Size: 564 Bytes
Versions: 55
Compression:
Stored size: 564 Bytes
Contents
require "rack-proxy" module GovukProxy class StaticProxy < Rack::Proxy def perform_request(env) request = Rack::Request.new(env) # use rack proxy to forward any requests for /assets/static/* # this regex needs to match the path set for `Rails.application.config.assets.prefix` in Static # https://github.com/alphagov/static/blob/main/config/initializers/assets.rb if request.path =~ %r{^/assets/static/} env["HTTP_HOST"] = @backend.host super(env) else @app.call(env) end end end end
Version data entries
55 entries across 55 versions & 1 rubygems