diff options
author | Timo Kösters <timo@koesters.xyz> | 2023-07-10 16:26:36 +0200 |
---|---|---|
committer | Timo Kösters <timo@koesters.xyz> | 2023-07-10 16:26:36 +0200 |
commit | c17187777f5f3bb06183ce423d990bc1c1061929 (patch) | |
tree | ff81de533cac0c8c0762a4af63aa9090ba9649ea /src/api/server_server.rs | |
parent | 78e7b711df213559150b5c6e7e7da1967d353e23 (diff) | |
download | conduit-c17187777f5f3bb06183ce423d990bc1c1061929.zip |
fix: never try federation with self
Diffstat (limited to 'src/api/server_server.rs')
-rw-r--r-- | src/api/server_server.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/api/server_server.rs b/src/api/server_server.rs index adb5f1f..0177f2a 100644 --- a/src/api/server_server.rs +++ b/src/api/server_server.rs @@ -123,6 +123,12 @@ where return Err(Error::bad_config("Federation is disabled.")); } + if destination == services().globals.server_name() { + return Err(Error::bad_config( + "Won't send federation request to ourselves", + )); + } + debug!("Preparing to send request to {destination}"); let mut write_destination_to_cache = false; |