Sha256: 425d914f506d3d1a517f65236006fdbdaecbed87d5003ac085b1ce39ccc6262a
Contents?: true
Size: 479 Bytes
Versions: 15
Compression:
Stored size: 479 Bytes
Contents
require 'rack/mount/utils' require 'grape' module Grape module Middleware class Prefixer < Base def prefix prefix = options[:prefix] || "" prefix = Rack::Mount::Utils.normalize_path(prefix) prefix end def before if env['PATH_INFO'].index(prefix) == 0 env['PATH_INFO'].sub!(prefix, '') env['PATH_INFO'] = Rack::Mount::Utils.normalize_path(env['PATH_INFO']) end end end end end
Version data entries
15 entries across 15 versions & 2 rubygems