diff options
author | Travis Ralston <travpc@gmail.com> | 2018-12-04 04:01:02 -0700 |
---|---|---|
committer | Richard van der Hoff <1389908+richvdh@users.noreply.github.com> | 2018-12-04 12:01:02 +0100 |
commit | 158ffb92f1ba0e247fb0a71f0d400655643ae68e (patch) | |
tree | 3ccda597fbe020866a6dc4fb7da53f64d19f845d /synapse/handlers/search.py | |
parent | Add note to UPGRADE.rst about removing riot.im from list of trusted identity ... (diff) | |
download | synapse-158ffb92f1ba0e247fb0a71f0d400655643ae68e.tar.xz |
Add an option to disable search for homeservers which may not be interested in it (#4230)
This is useful for homeservers not intended for users, such as bot-only homeservers or ones that only process IoT data.
Diffstat (limited to 'synapse/handlers/search.py')
-rw-r--r-- | synapse/handlers/search.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/synapse/handlers/search.py b/synapse/handlers/search.py index 80e7b15de8..ec936bbb4e 100644 --- a/synapse/handlers/search.py +++ b/synapse/handlers/search.py @@ -50,6 +50,9 @@ class SearchHandler(BaseHandler): dict to be returned to the client with results of search """ + if not self.hs.config.enable_search: + raise SynapseError(400, "Search is disabled on this homeserver") + batch_group = None batch_group_key = None batch_token = None |