From 30cb9f6d15afc5e4ba48a6d697ffbb4e77e56e8d Mon Sep 17 00:00:00 2001 From: R Midhun Suresh Date: Thu, 3 Feb 2022 12:01:08 +0530 Subject: [PATCH] Use includes instead of elaborate find Co-authored-by: Bruno Windels --- src/matrix/net/HomeServerRequest.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/matrix/net/HomeServerRequest.ts b/src/matrix/net/HomeServerRequest.ts index cbbb4e90..c3f49834 100644 --- a/src/matrix/net/HomeServerRequest.ts +++ b/src/matrix/net/HomeServerRequest.ts @@ -42,7 +42,7 @@ export class HomeServerRequest implements IHomeServerRequest { this._promise = sourceRequest.response().then(response => { log?.set("status", response.status); // ok? - if (response.status >= 200 && response.status < 300 || options?.allowedErrors?.find(e => e === response.status)) { + if (response.status >= 200 && response.status < 300 || options?.allowedErrors?.includes(response.status)) { log?.finish(); return response.body; } else {