Skip to content

Commit 006a82b

Browse files
authored
Merge pull request rails#43206 from rails/justin-case
Use an if statement instead of a case statement
2 parents a692e63 + 2c3ba1f commit 006a82b

File tree

1 file changed

+4
-3
lines changed
  • actionpack/lib/action_dispatch/http

1 file changed

+4
-3
lines changed

actionpack/lib/action_dispatch/http/url.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,10 @@ def port
270270
# req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080'
271271
# req.standard_port # => 80
272272
def standard_port
273-
case protocol
274-
when "https://" then 443
275-
else 80
273+
if "https://" == protocol
274+
443
275+
else
276+
80
276277
end
277278
end
278279

0 commit comments

Comments
 (0)