Skip to content

Commit

Permalink
Merge pull request #595 from benpickles/use-sub-not-gsub
Browse files Browse the repository at this point in the history
Use `sub` as we only need to substitute once.
  • Loading branch information
spastorino committed Aug 22, 2013
2 parents 6829a8a + f6673c7 commit 53e927c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rack/request.rb
Expand Up @@ -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
Expand Down

0 comments on commit 53e927c

Please sign in to comment.