Sha256: 51871bdb6505e1550f63c69905b50ac40452b81204043c964548a0ae231c0be4

Contents?: true

Size: 639 Bytes

Versions: 48

Compression:

Stored size: 639 Bytes

Contents

# Overwriting methods from Rack
module Rack
  class Request
    def host_with_port
      if forwarded = @env["HTTP_X_FORWARDED_HOST"]
        # Rails.logger.info "\n\nContour::Fixes Rack::Request::host_with_port"
        # Rails.logger.info "@env[HTTP_X_FORWARDED_HOST]: #{@env["HTTP_X_FORWARDED_HOST"]} USING: #{forwarded.split(/,\s?/).first}\n\n"
        # forwarded.split(/,\s?/).last
        # changed forwarded to first since we don't want the internal IP.
        forwarded.split(/,\s?/).first
      else
        @env['HTTP_HOST'] || "#{@env['SERVER_NAME'] || @env['SERVER_ADDR']}:#{@env['SERVER_PORT']}"
      end
    end
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
contour-2.0.0.beta.2 lib/contour/fixes/rack.rb
contour-2.0.0.beta.1 lib/contour/fixes/rack.rb
contour-1.3.0 lib/contour/fixes/rack.rb
contour-1.3.0.pre lib/contour/fixes/rack.rb
contour-1.2.1 lib/contour/fixes/rack.rb
contour-1.2.0 lib/contour/fixes/rack.rb
contour-1.2.0.pre8 lib/contour/fixes/rack.rb
contour-1.2.0.pre7 lib/contour/fixes/rack.rb
contour-1.2.0.pre6 lib/contour/fixes/rack.rb
contour-1.2.0.pre5 lib/contour/fixes/rack.rb
contour-1.2.0.pre4 lib/contour/fixes/rack.rb
contour-1.2.0.pre3 lib/contour/fixes/rack.rb
contour-1.2.0.pre2 lib/contour/fixes/rack.rb
contour-1.1.3 lib/contour/fixes/rack.rb
contour-1.2.0.pre lib/contour/fixes/rack.rb
contour-1.1.3.pre2 lib/contour/fixes/rack.rb
contour-1.1.3.pre lib/contour/fixes/rack.rb
contour-1.1.2 lib/contour/fixes/rack.rb
contour-1.1.2.pre2 lib/contour/fixes/rack.rb
contour-1.1.2.pre lib/contour/fixes/rack.rb