Fix crash when S3_ALIAS_HOST or S3_CLOUDFRONT_HOST have a path component (#25018)
This commit is contained in:
parent
2b45fecde1
commit
b922ad7a1b
2 changed files with 15 additions and 9 deletions
|
@ -169,11 +169,11 @@ module ApplicationHelper
|
|||
end
|
||||
|
||||
def storage_host
|
||||
URI::HTTPS.build(host: storage_host_name).to_s
|
||||
"https://#{storage_host_var}"
|
||||
end
|
||||
|
||||
def storage_host?
|
||||
storage_host_name.present?
|
||||
storage_host_var.present?
|
||||
end
|
||||
|
||||
def quote_wrap(text, line_width: 80, break_sequence: "\n")
|
||||
|
@ -234,7 +234,7 @@ module ApplicationHelper
|
|||
|
||||
private
|
||||
|
||||
def storage_host_name
|
||||
def storage_host_var
|
||||
ENV.fetch('S3_ALIAS_HOST', nil) || ENV.fetch('S3_CLOUDFRONT_HOST', nil)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue