Skip to content

Commit

Permalink
chore(deps): bump actix-multipart from 0.6.2 to 0.7.2 (#322)
Browse files Browse the repository at this point in the history
  • Loading branch information
tessus authored Jul 29, 2024
1 parent 4c40c8b commit e7f4214
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
9 changes: 4 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ shuttle = ["dep:shuttle-actix-web", "dep:shuttle-runtime", "dep:tokio"]
[dependencies]
actix-web = { version = "4.8.0" }
actix-web-grants = { version = "4.1.1" }
actix-multipart = "0.6.2"
actix-multipart = "0.7.2"
actix-files = "0.6.6"
shuttle-actix-web = { version = "0.47.0", optional = true }
shuttle-runtime = { version = "0.47.0", optional = true }
Expand Down
9 changes: 8 additions & 1 deletion src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,14 @@ async fn upload(
while let Some(item) = payload.next().await {
let header_filename = header::parse_header_filename(request.headers())?;
let mut field = item?;
let content = ContentDisposition::from(field.content_disposition().clone());
let content = ContentDisposition::from(
field
.content_disposition()
.ok_or_else(|| {
error::ErrorInternalServerError("payload must contain content disposition")
})?
.clone(),
);
if let Ok(paste_type) = PasteType::try_from(&content) {
let mut bytes = Vec::<u8>::new();
while let Some(chunk) = field.next().await {
Expand Down

0 comments on commit e7f4214

Please sign in to comment.