mirror of
https://github.com/matrix-org/mjolnir.git
synced 2024-10-01 05:36:06 +00:00
Remove silly this.config find-replace mistake
This commit is contained in:
parent
9a590244d1
commit
4d7b7e1b20
@ -49,7 +49,7 @@ export class WebAPIs {
|
|||||||
|
|
||||||
// configure /report API.
|
// configure /report API.
|
||||||
if (this.config.web.abuseReporting.enabled) {
|
if (this.config.web.abuseReporting.enabled) {
|
||||||
console.log(`this.configuring ${API_PREFIX}/report/:room_id/:event_id...`);
|
console.log(`configuring ${API_PREFIX}/report/:room_id/:event_id...`);
|
||||||
this.webController.options(`${API_PREFIX}/report/:room_id/:event_id`, async (request, response) => {
|
this.webController.options(`${API_PREFIX}/report/:room_id/:event_id`, async (request, response) => {
|
||||||
// reply with CORS options
|
// reply with CORS options
|
||||||
response.header("Access-Control-Allow-Origin", "*");
|
response.header("Access-Control-Allow-Origin", "*");
|
||||||
@ -66,23 +66,23 @@ export class WebAPIs {
|
|||||||
response.header("Access-Control-Allow-Methods", "POST, OPTIONS");
|
response.header("Access-Control-Allow-Methods", "POST, OPTIONS");
|
||||||
await this.handleReport({ request, response, roomId: request.params.room_id, eventId: request.params.event_id })
|
await this.handleReport({ request, response, roomId: request.params.room_id, eventId: request.params.event_id })
|
||||||
});
|
});
|
||||||
console.log(`this.configuring ${API_PREFIX}/report/:room_id/:event_id... DONE`);
|
console.log(`configuring ${API_PREFIX}/report/:room_id/:event_id... DONE`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// this.configure ruleServer API.
|
// configure ruleServer API.
|
||||||
// FIXME: Doesn't this need some kind of access control?
|
// FIXME: Doesn't this need some kind of access control?
|
||||||
// See https://github.com/matrix-org/mjolnir/issues/139#issuecomment-1012221479.
|
// See https://github.com/matrix-org/mjolnir/issues/139#issuecomment-1012221479.
|
||||||
if (this.config.web.ruleServer?.enabled) {
|
if (this.config.web.ruleServer?.enabled) {
|
||||||
const updatesUrl = `${API_PREFIX}/ruleserver/updates`;
|
const updatesUrl = `${API_PREFIX}/ruleserver/updates`;
|
||||||
LogService.info("WebAPIs", `this.configuring ${updatesUrl}...`);
|
LogService.info("WebAPIs", `configuring ${updatesUrl}...`);
|
||||||
if (!this.ruleServer) {
|
if (!this.ruleServer) {
|
||||||
throw new Error("The rule server to use has not been this.configured for the WebAPIs.");
|
throw new Error("The rule server to use has not been configured for the WebAPIs.");
|
||||||
}
|
}
|
||||||
const ruleServer: RuleServer = this.ruleServer;
|
const ruleServer: RuleServer = this.ruleServer;
|
||||||
this.webController.get(updatesUrl, async (request, response) => {
|
this.webController.get(updatesUrl, async (request, response) => {
|
||||||
await this.handleRuleServerUpdate(ruleServer, { request, response, since: request.query.since as string});
|
await this.handleRuleServerUpdate(ruleServer, { request, response, since: request.query.since as string});
|
||||||
});
|
});
|
||||||
LogService.info("WebAPIs", `this.configuring ${updatesUrl}... DONE`);
|
LogService.info("WebAPIs", `configuring ${updatesUrl}... DONE`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user