File tree Expand file tree Collapse file tree 3 files changed +3
-2
lines changed
Expand file tree Collapse file tree 3 files changed +3
-2
lines changed Original file line number Diff line number Diff line change 55* [ #2629 ] ( https://github.com/ruby-grape/grape/pull/2629 ) : Refactor Router Architecture - [ @ericproulx ] ( https://github.com/ericproulx ) .
66* [ #2633 ] ( https://github.com/ruby-grape/grape/pull/2633 ) : Refactor API::Instance and reorganize DSL modules - [ @ericproulx ] ( https://github.com/ericproulx ) .
77* [ #2636 ] ( https://github.com/ruby-grape/grape/pull/2636 ) : Refactor router to simplify method signatures and reduce duplication - [ @ericproulx ] ( https://github.com/ericproulx ) .
8+ * [ #2638 ] ( https://github.com/ruby-grape/grape/pull/2638 ) : Remove unnecessary path string duplication - [ @ericproulx ] ( https://github.com/ericproulx ) .
89* Your contribution here.
910
1011#### Fixes
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ def before
2222 return if path_info == '/'
2323
2424 [ mount_path , Grape ::Router . normalize_path ( prefix ) ] . each do |path |
25- path_info . delete_prefix! ( path ) if path . present? && path != '/' && path_info . start_with? ( path )
25+ path_info = path_info . delete_prefix ( path ) if path . present? && path != '/' && path_info . start_with? ( path )
2626 end
2727
2828 slash_position = path_info . index ( '/' , 1 ) # omit the first one
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ def self.normalize_path(path)
1616 return path if path == '/'
1717
1818 # Fast path for the overwhelming majority of paths that don't need to be normalized
19- return path . dup if path . start_with? ( '/' ) && !( path . end_with? ( '/' ) || path . match? ( %r{%|//} ) )
19+ return path if path . start_with? ( '/' ) && !( path . end_with? ( '/' ) || path . match? ( %r{%|//} ) )
2020
2121 # Slow path
2222 encoding = path . encoding
You can’t perform that action at this time.
0 commit comments