class Rack::App::Middlewares::PathInfoCutter

Public Class Methods

new(app, cut_string_from_path) click to toggle source
# File lib/rack/app/middlewares/path_info_cutter.rb, line 3
def initialize(app, cut_string_from_path)
  @cut_string_from_path = cut_string_from_path
  @app = app
end

Public Instance Methods

call(env) click to toggle source
# File lib/rack/app/middlewares/path_info_cutter.rb, line 8
def call(env)
  #env[::Rack::App::Constants::ENV::ORIGINAL_PATH_INFO]= env[::Rack::App::Constants::ENV::PATH_INFO]
  env[::Rack::App::Constants::ENV::PATH_INFO]= env[::Rack::App::Constants::ENV::PATH_INFO].dup
  env[::Rack::App::Constants::ENV::PATH_INFO].sub!(@cut_string_from_path, '')
  @app.call(env)
end