summaryrefslogtreecommitdiff
path: root/src/util.rs
diff options
context:
space:
mode:
authorDaniel García <[email protected]>2023-07-03 19:58:14 +0200
committerDaniel García <[email protected]>2023-07-03 19:58:14 +0200
commit60964c07e6d178ae632d821e5698eee681f3d3c7 (patch)
tree81316d5bc4f7f8efe7e0892286a2fd8ceb74fc0e /src/util.rs
parente7f083dee9743bfe4937f5c8149fa9d8383edb96 (diff)
downloadvaultwarden-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.rs13
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 {