Compare commits

...

4 Commits

@ -58,6 +58,14 @@ This error type correctly inherits from `Error`, and can be used with `instanceo
## Changelog
### 1.0.3 (August 31, 2019)
- Added missing Bluebird dependency to `package.json` (as a non-development dependency).
### 1.0.2 (August 31, 2019)
- DNS errors now also result in a `LookupFailed` error, like they should.
### 1.0.1 (August 30, 2019)
- Added input validation with an informative error to the `discover` method.

@ -60,6 +60,8 @@ function validateHomeserverUrl(homeserverUrl) {
throwLookupError("homeserver returned invalid JSON, maybe it is not a Matrix server?");
}).catch(ValidationError, (_error) => {
throwLookupError("homeserver returned an invalid version response, maybe it is not a Matrix server?");
}).catch({ code: "ENOTFOUND" }, () => {
throwLookupError("hostname of homeserver does not exist");
});
}
@ -150,6 +152,8 @@ function attemptWellKnown(host) {
}
}).catch(getJson.ParsingFailed, (_error) => {
throwLookupError("host returned invalid JSON");
}).catch({ code: "ENOTFOUND" }, () => {
throwLookupError("hostname does not exist");
});
}

@ -1,7 +1,7 @@
{
"name": "@modular-matrix/autodiscover-client-configuration",
"description": "Auto-discovers Matrix client configuration for a given hostname (including eg. doing a .well-known lookup)",
"version": "1.0.1",
"version": "1.0.3",
"main": "index.js",
"repository": "http://git.cryto.net/modular-matrix/autodiscover-client-configuration.git",
"author": "Sven Slootweg <admin@cryto.net>",
@ -12,11 +12,11 @@
"axios-get-json-response": "^1.0.1",
"create-error": "^0.3.1",
"dotty": "^0.1.0",
"validatem": "^0.2.0"
"validatem": "^0.2.0",
"bluebird": "^3.5.5"
},
"devDependencies": {
"@joepie91/eslint-config": "^1.1.0",
"bluebird": "^3.5.5",
"eslint": "^6.2.2"
}
}

Loading…
Cancel
Save