Skip to content

Commit 073d90c

Browse files
authored
Merge pull request rails#47735 from nirebu/nirebu/stop-root-string-allocation-in-helper
Do not allocate the first character when checking for relative paths
2 parents 2269894 + 14c6e04 commit 073d90c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

actionpack/lib/action_dispatch/routing/redirection.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def inspect
6868

6969
private
7070
def relative_path?(path)
71-
path && !path.empty? && path[0] != "/"
71+
path && !path.empty? && !path.start_with?("/")
7272
end
7373

7474
def escape(params)

0 commit comments

Comments
 (0)