This commit is contained in:
@@ -31,12 +31,12 @@ pub async fn upload(MultipartForm(mut form): MultipartForm<UploadDiskImageForm>)
|
||||
}
|
||||
|
||||
// Check file mime type
|
||||
if let Some(mime_type) = file.content_type {
|
||||
if !constants::ALLOWED_DISK_IMAGES_MIME_TYPES.contains(&mime_type.as_ref()) {
|
||||
return Ok(HttpResponse::BadRequest().json(format!(
|
||||
"Unsupported file type for disk upload: {mime_type}"
|
||||
)));
|
||||
}
|
||||
if let Some(mime_type) = file.content_type
|
||||
&& !constants::ALLOWED_DISK_IMAGES_MIME_TYPES.contains(&mime_type.as_ref())
|
||||
{
|
||||
return Ok(HttpResponse::BadRequest().json(format!(
|
||||
"Unsupported file type for disk upload: {mime_type}"
|
||||
)));
|
||||
}
|
||||
|
||||
// Extract and check file name
|
||||
|
||||
Reference in New Issue
Block a user