diff --git a/docs/features/directory-users.md b/docs/features/directory-users.md index 304e758..e77bf1d 100644 --- a/docs/features/directory-users.md +++ b/docs/features/directory-users.md @@ -3,12 +3,12 @@ - For SQL: Use `synapseSql` module with `type: {sqlite|postgresql}` and `database` as JDBC url after `jdbc:driver:` - `/path/to/db` for `sqlite` - `//host/db?username...` for `postgresql`) -- Configure DNS overwrite for domain name (and mention ${matrix.domain} can be used) +- Configure DNS overwrite for the Homeserver hostname used when connecting as a client (and mention ${matrix.domain} can be used) ``` dns.overwrite.homeserver.client: - name: 'example.org' value: 'http://localhost:8008' ``` - Configure reverse proxy - - for `/_matrix/client/r0/user_directory/search` to `http://internalIp:8008/_matrix/client/r0/user_directory/search` + - for `/_matrix/client/r0/user_directory/search` to `http://internalIpOfMxisd:8090/_matrix/client/r0/user_directory/search` - With `ProxyPreserveHost on` on apache diff --git a/src/main/java/io/kamax/mxisd/directory/DirectoryManager.java b/src/main/java/io/kamax/mxisd/directory/DirectoryManager.java index eebd1ac..b7c2d0b 100644 --- a/src/main/java/io/kamax/mxisd/directory/DirectoryManager.java +++ b/src/main/java/io/kamax/mxisd/directory/DirectoryManager.java @@ -21,6 +21,7 @@ package io.kamax.mxisd.directory; import com.google.gson.Gson; +import com.google.gson.JsonSyntaxException; import io.kamax.matrix.MatrixErrorInfo; import io.kamax.mxisd.controller.directory.v1.io.UserDirectorySearchRequest; import io.kamax.mxisd.controller.directory.v1.io.UserDirectorySearchResult; @@ -96,8 +97,10 @@ public class DirectoryManager { if (resultHs.isLimited()) { result.setLimited(true); } + } catch (JsonSyntaxException e) { + throw new InternalServerError("Invalid JSON reply from the HS: " + e.getMessage()); } catch (IOException e) { - throw new InternalServerError(e); + throw new InternalServerError("Unable to query the HS: I/O error: " + e.getMessage()); } for (IDirectoryProvider provider : providers) {