FIX: Upload#short_url generates incorrect URL when extension is nil.

This commit is contained in:
Guo Xiang Tan
2019-06-19 09:10:50 +08:00
parent e8b9f38374
commit 73a45048a0
4 changed files with 9 additions and 3 deletions

View File

@ -361,7 +361,7 @@ class Upload < ActiveRecord::Base
private
def short_url_basename
"#{Upload.base62_sha1(sha1)}.#{extension}"
"#{Upload.base62_sha1(sha1)}#{extension.present? ? ".#{extension}" : ""}"
end
end