Replace remaining icon.ext image paths with hash (#435)
Co-authored-by: Geometrically <18202329+Geometrically@users.noreply.github.com>
This commit is contained in:
parent
0bbb6b91fe
commit
4c1dca73c4
@ -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?;
|
||||
|
||||
@ -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?;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user