diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2013-08-22 12:03:17 -0700 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2013-08-22 12:03:17 -0700 |
commit | 53e927c824af234415c632aa19d38ffac9262017 (patch) | |
tree | 90818090dbabdad71c12d62df7d66b183234f4a2 | |
parent | 6829a8a0f416ea49a18f1e3e532ed1ece24e9ea4 (diff) | |
parent | f6673c77ef477f054c40a84c34e1bc71db24379a (diff) | |
download | rack-53e927c824af234415c632aa19d38ffac9262017.tar.gz |
Merge pull request #595 from benpickles/use-sub-not-gsub
Use `sub` as we only need to substitute once.
-rw-r--r-- | lib/rack/request.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/rack/request.rb b/lib/rack/request.rb index f3a048ab..605f8f4d 100644 --- a/lib/rack/request.rb +++ b/lib/rack/request.rb @@ -109,7 +109,7 @@ module Rack def host # Remove port number. - host_with_port.to_s.gsub(/:\d+\z/, '') + host_with_port.to_s.sub(/:\d+\z/, '') end def script_name=(s); @env["SCRIPT_NAME"] = s.to_s end |