Handle missing Retry-After
header with challenge errors
This commit is contained in:
parent
7f50fcdb54
commit
480e5b58c7
1 changed files with 2 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2020 Signal Messenger, LLC
|
||||
// Copyright 2020-2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
|
@ -167,7 +167,7 @@ export class SendMessageChallengeError extends ReplayableError {
|
|||
const headers = httpError.responseHeaders || {};
|
||||
|
||||
this.retryAfter =
|
||||
Date.now() + parseRetryAfter(headers['retry-after'].toString());
|
||||
Date.now() + parseRetryAfter((headers['retry-after'] ?? 0).toString());
|
||||
|
||||
appendStack(this, httpError);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue