mirror of
https://github.com/danbulant/Portfolio
synced 2026-06-14 03:51:27 +00:00
fix: fix critical bug in zip/letter data guard preventing correct behaviour
This commit is contained in:
parent
78d77cd735
commit
32023f14a4
2 changed files with 2 additions and 6 deletions
|
|
@ -16,9 +16,7 @@ impl<'r> FromData<'r> for Letter {
|
|||
type Error = Option<String>;
|
||||
|
||||
async fn from_data(req: &'r Request<'_>, data: Data<'r>) -> data::Outcome<'r, Self> {
|
||||
let content_type_pdf = ContentType::new("application", "application/pdf");
|
||||
|
||||
if req.content_type() != Some(&content_type_pdf) {
|
||||
if req.content_type() != Some(&ContentType::PDF) {
|
||||
return Outcome::Failure((Status::BadRequest, None))
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,9 +16,7 @@ impl<'r> FromData<'r> for Portfolio {
|
|||
type Error = Option<String>;
|
||||
|
||||
async fn from_data(req: &'r Request<'_>, data: Data<'r>) -> data::Outcome<'r, Self> {
|
||||
let content_type_zip = ContentType::new("application", "application/zip");
|
||||
|
||||
if req.content_type() != Some(&content_type_zip) {
|
||||
if req.content_type() != Some(&ContentType::ZIP) {
|
||||
return Outcome::Failure((Status::BadRequest, None))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue