Clarify some constants
This commit is contained in:
@ -26,7 +26,7 @@ pub async fn upload_file(MultipartForm(mut form): MultipartForm<UploadIsoForm>)
|
||||
|
||||
let file = form.files.remove(0);
|
||||
|
||||
if file.size > constants::ISO_MAX_SIZE {
|
||||
if file.size > constants::ISO_MAX_SIZE.as_bytes() {
|
||||
log::error!("Uploaded ISO file is too large!");
|
||||
return Ok(HttpResponse::BadRequest().json("File is too large!"));
|
||||
}
|
||||
@ -88,7 +88,7 @@ pub async fn upload_from_url(req: web::Json<DownloadFromURLReq>) -> HttpResult {
|
||||
let response = reqwest::get(&req.url).await?;
|
||||
|
||||
if let Some(len) = response.content_length() {
|
||||
if len > constants::ISO_MAX_SIZE as u64 {
|
||||
if len > constants::ISO_MAX_SIZE.as_bytes() as u64 {
|
||||
return Ok(HttpResponse::BadRequest().json("File is too large!"));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user