mirror of
https://github.com/dani-garcia/vaultwarden
synced 2024-12-14 17:43:46 +01:00
Merge pull request #2650 from BlackDex/mitigate-mobile-client-uploads
Mitigate attachment/send upload issues
This commit is contained in:
commit
ce9d93003c
2 changed files with 22 additions and 0 deletions
|
@ -947,6 +947,17 @@ async fn save_attachment(
|
||||||
|
|
||||||
let mut data = data.into_inner();
|
let mut data = data.into_inner();
|
||||||
|
|
||||||
|
// There seems to be a bug somewhere regarding uploading attachments using the Android Client (Maybe iOS too?)
|
||||||
|
// See: https://github.com/dani-garcia/vaultwarden/issues/2644
|
||||||
|
// Since all other clients seem to match TempFile::File and not TempFile::Buffered lets catch this and return an error for now.
|
||||||
|
// We need to figure out how to solve this, but for now it's better to not accept these attachments since they will be broken.
|
||||||
|
if let TempFile::Buffered {
|
||||||
|
content: _,
|
||||||
|
} = &data.data
|
||||||
|
{
|
||||||
|
err!("Error reading attachment data. Please try an other client.");
|
||||||
|
}
|
||||||
|
|
||||||
if let Some(size_limit) = size_limit {
|
if let Some(size_limit) = size_limit {
|
||||||
if data.data.len() > size_limit {
|
if data.data.len() > size_limit {
|
||||||
err!("Attachment storage limit exceeded with this file");
|
err!("Attachment storage limit exceeded with this file");
|
||||||
|
|
|
@ -216,6 +216,17 @@ async fn post_send_file(data: Form<UploadData<'_>>, headers: Headers, conn: DbCo
|
||||||
err!("Send content is not a file");
|
err!("Send content is not a file");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// There seems to be a bug somewhere regarding uploading attachments using the Android Client (Maybe iOS too?)
|
||||||
|
// See: https://github.com/dani-garcia/vaultwarden/issues/2644
|
||||||
|
// Since all other clients seem to match TempFile::File and not TempFile::Buffered lets catch this and return an error for now.
|
||||||
|
// We need to figure out how to solve this, but for now it's better to not accept these attachments since they will be broken.
|
||||||
|
if let TempFile::Buffered {
|
||||||
|
content: _,
|
||||||
|
} = &data
|
||||||
|
{
|
||||||
|
err!("Error reading send file data. Please try an other client.");
|
||||||
|
}
|
||||||
|
|
||||||
let size = data.len();
|
let size = data.len();
|
||||||
if size > size_limit {
|
if size > size_limit {
|
||||||
err!("Attachment storage limit exceeded with this file");
|
err!("Attachment storage limit exceeded with this file");
|
||||||
|
|
Loading…
Reference in a new issue