diff options
author | Daniel García <[email protected]> | 2023-07-03 19:58:14 +0200 |
---|---|---|
committer | Daniel García <[email protected]> | 2023-07-03 19:58:14 +0200 |
commit | 60964c07e6d178ae632d821e5698eee681f3d3c7 (patch) | |
tree | 81316d5bc4f7f8efe7e0892286a2fd8ceb74fc0e /src/util.rs | |
parent | e7f083dee9743bfe4937f5c8149fa9d8383edb96 (diff) | |
download | vaultwarden-60964c07e6d178ae632d821e5698eee681f3d3c7.tar.gz vaultwarden-60964c07e6d178ae632d821e5698eee681f3d3c7.zip |
Add some extra access checks for attachments and groups
Diffstat (limited to 'src/util.rs')
-rw-r--r-- | src/util.rs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/util.rs b/src/util.rs index 6de97ef6..e12e334b 100644 --- a/src/util.rs +++ b/src/util.rs @@ -1,7 +1,10 @@ // // Web Headers and caching // -use std::io::{Cursor, ErrorKind}; +use std::{ + io::{Cursor, ErrorKind}, + ops::Deref, +}; use rocket::{ fairing::{Fairing, Info, Kind}, @@ -209,6 +212,14 @@ impl std::fmt::Display for SafeString { } } +impl Deref for SafeString { + type Target = String; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} + impl AsRef<Path> for SafeString { #[inline] fn as_ref(&self) -> &Path { |