Skip to content

Commit

Permalink
Use sub as we only need to substitute once.
Browse files Browse the repository at this point in the history
(Hence the use of `\z`)
  • Loading branch information
benpickles committed Aug 20, 2013
1 parent 6829a8a commit f6673c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rack/request.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def port


def host def host
# Remove port number. # Remove port number.
host_with_port.to_s.gsub(/:\d+\z/, '') host_with_port.to_s.sub(/:\d+\z/, '')
end end


def script_name=(s); @env["SCRIPT_NAME"] = s.to_s end def script_name=(s); @env["SCRIPT_NAME"] = s.to_s end
Expand Down

0 comments on commit f6673c7

Please sign in to comment.