1
0
Fork 0
mirror of https://github.com/dani-garcia/vaultwarden.git synced 2025-07-21 19:48:24 +00:00

Attachment size limits, per-user and per-organization

This commit is contained in:
Daniel García 2020-02-17 22:56:26 +01:00
commit 325039c316
No known key found for this signature in database
GPG key ID: FC8A7D14C3CD543A
4 changed files with 83 additions and 8 deletions

View file

@ -211,6 +211,18 @@ macro_rules! err {
}};
}
#[macro_export]
macro_rules! err_discard {
($msg:expr, $data:expr) => {{
std::io::copy(&mut $data.open(), &mut std::io::sink()).ok();
return Err(crate::error::Error::new($msg, $msg));
}};
($usr_msg:expr, $log_value:expr, $data:expr) => {{
std::io::copy(&mut $data.open(), &mut std::io::sink()).ok();
return Err(crate::error::Error::new($usr_msg, $log_value));
}};
}
#[macro_export]
macro_rules! err_json {
($expr:expr, $log_value:expr) => {{