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-6.1.0 lib/rack/app/request_configurator.rb
rack-app-6.0.0 lib/rack/app/request_configurator.rb
rack-app-5.12.0 lib/rack/app/request_configurator.rb
rack-app-5.11.1 lib/rack/app/request_configurator.rb
rack-app-5.11.0 lib/rack/app/request_configurator.rb
rack-app-5.10.2 lib/rack/app/request_configurator.rb
rack-app-5.10.1 lib/rack/app/request_configurator.rb
rack-app-5.10.0 lib/rack/app/request_configurator.rb
rack-app-5.9.0 lib/rack/app/request_configurator.rb
rack-app-5.8.0 lib/rack/app/request_configurator.rb
rack-app-5.7.0 lib/rack/app/request_configurator.rb
rack-app-5.7.0.rc lib/rack/app/request_configurator.rb
rack-app-5.6.0 lib/rack/app/request_configurator.rb
rack-app-5.5.1 lib/rack/app/request_configurator.rb