Replace remaining icon.ext image paths with hash (#435)

Co-authored-by: Geometrically <18202329+Geometrically@users.noreply.github.com>
This commit is contained in:
wafflecoffee 2022-09-02 15:19:39 -04:00 committed by GitHub
parent 0bbb6b91fe
commit 4c1dca73c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -907,10 +907,11 @@ async fn process_icon_upload(
)
.await?;
let hash = sha1::Sha1::from(&data).hexdigest();
let upload_data = file_host
.upload_file(
content_type,
&format!("data/{}/icon.{}", project_id, file_extension),
&format!("data/{}/{}.{}", project_id, hash, file_extension),
data.freeze(),
)
.await?;

View File

@ -354,10 +354,11 @@ pub async fn user_icon_edit(
)
.await?;
let hash = sha1::Sha1::from(&bytes).hexdigest();
let upload_data = file_host
.upload_file(
content_type,
&format!("user/{}/icon.{}", user_id, ext.ext),
&format!("user/{}/{}.{}", user_id, hash, ext.ext),
bytes.freeze(),
)
.await?;