Sha256: 88bb8255abcbe35b510c0b07ca2b107a3b90fb4a89e2047c31ea2a84859b601c

Contents?: true

Size: 365 Bytes

Versions: 38

Compression:

Stored size: 365 Bytes

Contents

# frozen_string_literal: true

# https://github.com/rails/rails/issues/22965
module Shimmer
  class CloudflareProxy
    def initialize(app)
      @app = app
    end

    def call(env)
      return @app.call(env) unless env["HTTP_CF_VISITOR"]

      env["HTTP_X_FORWARDED_PROTO"] = JSON.parse(env["HTTP_CF_VISITOR"])["scheme"]
      @app.call(env)
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
shimmer-0.0.41 lib/shimmer/middlewares/cloudflare.rb
shimmer-0.0.40 lib/shimmer/middlewares/cloudflare.rb
shimmer-0.0.39 lib/shimmer/middlewares/cloudflare.rb
shimmer-0.0.38 lib/shimmer/middlewares/cloudflare.rb
shimmer-0.0.37 lib/shimmer/middlewares/cloudflare.rb
shimmer-0.0.36 lib/shimmer/middlewares/cloudflare.rb
shimmer-0.0.35 lib/shimmer/middlewares/cloudflare.rb
shimmer-0.0.34 lib/shimmer/middlewares/cloudflare.rb
shimmer-0.0.33 lib/shimmer/middlewares/cloudflare.rb
shimmer-0.0.32 lib/shimmer/middlewares/cloudflare.rb
shimmer-0.0.31 lib/shimmer/middlewares/cloudflare.rb
shimmer-0.0.30 lib/shimmer/middlewares/cloudflare.rb
shimmer-0.0.29 lib/shimmer/middlewares/cloudflare.rb
shimmer-0.0.28 lib/shimmer/middlewares/cloudflare.rb
shimmer-0.0.27 lib/shimmer/middlewares/cloudflare.rb
shimmer-0.0.26 lib/shimmer/middlewares/cloudflare.rb
shimmer-0.0.25 lib/shimmer/middlewares/cloudflare.rb
shimmer-0.0.24 lib/shimmer/middlewares/cloudflare.rb
shimmer-0.0.23 lib/shimmer/middlewares/cloudflare.rb
shimmer-0.0.22 lib/shimmer/middlewares/cloudflare.rb