forked from mystiq/hydrogen-web
Use includes instead of elaborate find
Co-authored-by: Bruno Windels <brunow@matrix.org>
This commit is contained in:
parent
a351a185a0
commit
30cb9f6d15
1 changed files with 1 additions and 1 deletions
|
@ -42,7 +42,7 @@ export class HomeServerRequest implements IHomeServerRequest {
|
||||||
this._promise = sourceRequest.response().then(response => {
|
this._promise = sourceRequest.response().then(response => {
|
||||||
log?.set("status", response.status);
|
log?.set("status", response.status);
|
||||||
// ok?
|
// 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();
|
log?.finish();
|
||||||
return response.body;
|
return response.body;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue