Sha256: 174357ee4d7510dfcbdbad3096ad5993425f8d6372fedf7ae5660a5b9e0d1229

Contents?: true

Size: 634 Bytes

Versions: 54

Compression:

Stored size: 634 Bytes

Contents

module Rack::App::RequestConfigurator

  extend self

  def configure(env)
    set_path_info(env)
    set_extname(env)
  end

  protected

  EXTNAME = ::Rack::App::Constants::ENV::EXTNAME
  PATH_INFO = ::Rack::App::Constants::ENV::PATH_INFO
  ORIGINAL_PATH_INFO = ::Rack::App::Constants::ENV::ORIGINAL_PATH_INFO

  def set_path_info(env)
    path_info = env[PATH_INFO]
    env[ORIGINAL_PATH_INFO]= path_info.dup
    env[PATH_INFO]= Rack::App::Utils.normalize_path(path_info)
  end

  def set_extname(env)
    path_info = env[PATH_INFO]
    basename = path_info.split("/").last.to_s
    env[EXTNAME]= File.extname(basename)
  end

end

Version data entries

54 entries across 54 versions & 2 rubygems

Version Path
rack-app-11.0.2 lib/rack/app/request_configurator.rb
rack-app-11.0.1 lib/rack/app/request_configurator.rb
rack-app-11.0.0 lib/rack/app/request_configurator.rb
rack-app-10.0.0 lib/rack/app/request_configurator.rb
rack-app-9.0.0 lib/rack/app/request_configurator.rb
rack-app-8.1.0 lib/rack/app/request_configurator.rb
rack-app-8.0.1 lib/rack/app/request_configurator.rb
rack-app-8.0.0 lib/rack/app/request_configurator.rb
mountapi-0.11.1 vendor/bundle/ruby/2.7.0/gems/rack-app-7.7.0/lib/rack/app/request_configurator.rb
rack-app-7.7.0 lib/rack/app/request_configurator.rb
rack-app-7.6.5 lib/rack/app/request_configurator.rb
rack-app-7.6.4 lib/rack/app/request_configurator.rb
rack-app-7.6.3 lib/rack/app/request_configurator.rb
rack-app-7.6.2 lib/rack/app/request_configurator.rb
rack-app-7.6.1 lib/rack/app/request_configurator.rb
rack-app-7.6.0 lib/rack/app/request_configurator.rb
rack-app-7.5.2 lib/rack/app/request_configurator.rb
rack-app-7.5.1 lib/rack/app/request_configurator.rb
rack-app-7.5.0 lib/rack/app/request_configurator.rb
rack-app-7.4.0 lib/rack/app/request_configurator.rb