Skip to content
Browse files

Use `sub` as we only need to substitute once.

(Hence the use of `\z`)
  • Loading branch information...
1 parent 6829a8a commit f6673c77ef477f054c40a84c34e1bc71db24379a @benpickles benpickles committed Aug 20, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/rack/request.rb
View
2 lib/rack/request.rb
@@ -109,7 +109,7 @@ def port
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

0 comments on commit f6673c7

Please sign in to comment.
Something went wrong with that request. Please try again.