diff options
author | Vika Shleina <vika@fireburn.ru> | 2021-07-19 10:32:42 +0300 |
---|---|---|
committer | Vika Shleina <vika@fireburn.ru> | 2021-07-19 10:55:32 +0300 |
commit | 47c3b54d1d0b276fb87d1b4b71a584e0e0c7b43d (patch) | |
tree | 9b9b9d2512a91da502187d17cb9c1e5dce398009 /src/database/mod.rs | |
parent | 8399371adc5c48e1847061deee1936c0d64f2a85 (diff) | |
download | kittybox-47c3b54d1d0b276fb87d1b4b71a584e0e0c7b43d.tar.zst |
Relaxed anti-takeover URL check to simply not place redirects at foreign URLs
Diffstat (limited to 'src/database/mod.rs')
-rw-r--r-- | src/database/mod.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/database/mod.rs b/src/database/mod.rs index 8579125..e0e4e7b 100644 --- a/src/database/mod.rs +++ b/src/database/mod.rs @@ -123,7 +123,7 @@ pub trait Storage: Clone + Send + Sync { /// Save a post to the database as an MF2-JSON structure. /// /// Note that the `post` object MUST have `post["properties"]["uid"][0]` defined. - async fn put_post<'a>(&self, post: &'a serde_json::Value) -> Result<()>; + async fn put_post<'a>(&self, post: &'a serde_json::Value, user: &'a str) -> Result<()>; /*/// Save a post and add it to the relevant feeds listed in `post["properties"]["channel"]`. /// @@ -198,7 +198,7 @@ mod tests { let alt_url = post["properties"]["url"][1].as_str().unwrap().to_string(); // Reading and writing - backend.put_post(&post).await.unwrap(); + backend.put_post(&post, "https://fireburn.ru/").await.unwrap(); if let Ok(Some(returned_post)) = backend.get_post(&key).await { assert!(returned_post.is_object()); assert_eq!( @@ -254,7 +254,7 @@ mod tests { }, "children": [] }); - backend.put_post(&feed).await.unwrap(); + backend.put_post(&feed, "https://fireburn.ru/").await.unwrap(); let chans = backend .get_channels(&crate::indieauth::User::new( "https://fireburn.ru/", |