Skip to content

Commit 788cfe1

Browse files
author
Mattia Roccoberton
committed
refactor: minor change to current_host method
1 parent f8e9b14 commit 788cfe1

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

lib/active_storage/service/db_service_rails70.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ def compose(source_keys, destination_key, **)
1919

2020
def current_host
2121
opts = url_options || {}
22-
url = "#{opts[:protocol]}#{opts[:host]}"
23-
url += ":#{opts[:port]}" if opts[:port]
24-
url
22+
opts[:port] ? "#{opts[:protocol]}#{opts[:host]}:#{opts[:port]}" : "#{opts[:protocol]}#{opts[:host]}"
2523
end
2624

2725
def private_url(key, expires_in:, filename:, content_type:, disposition:, **)

0 commit comments

Comments
 (0)