You've already forked AstralRinth
forked from didirus/AstralRinth
Replace remaining icon.ext image paths with hash (#435)
Co-authored-by: Geometrically <18202329+Geometrically@users.noreply.github.com>
This commit is contained in:
@@ -907,10 +907,11 @@ async fn process_icon_upload(
|
|||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
|
let hash = sha1::Sha1::from(&data).hexdigest();
|
||||||
let upload_data = file_host
|
let upload_data = file_host
|
||||||
.upload_file(
|
.upload_file(
|
||||||
content_type,
|
content_type,
|
||||||
&format!("data/{}/icon.{}", project_id, file_extension),
|
&format!("data/{}/{}.{}", project_id, hash, file_extension),
|
||||||
data.freeze(),
|
data.freeze(),
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
|||||||
@@ -354,10 +354,11 @@ pub async fn user_icon_edit(
|
|||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
|
let hash = sha1::Sha1::from(&bytes).hexdigest();
|
||||||
let upload_data = file_host
|
let upload_data = file_host
|
||||||
.upload_file(
|
.upload_file(
|
||||||
content_type,
|
content_type,
|
||||||
&format!("user/{}/icon.{}", user_id, ext.ext),
|
&format!("user/{}/{}.{}", user_id, hash, ext.ext),
|
||||||
bytes.freeze(),
|
bytes.freeze(),
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
|||||||
Reference in New Issue
Block a user