Restart input stream on retried request
Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
This commit is contained in:
parent
87f7203141
commit
45425c158d
2 changed files with 5 additions and 5 deletions
|
@ -169,7 +169,7 @@ type PromiseAjaxOptionsType = {
|
|||
basicAuth?: string;
|
||||
certificateAuthority?: string;
|
||||
contentType?: string;
|
||||
data?: Uint8Array | Readable | string;
|
||||
data?: Uint8Array | (() => Readable) | string;
|
||||
disableRetries?: boolean;
|
||||
disableSessionResumption?: boolean;
|
||||
headers?: HeaderListType;
|
||||
|
@ -299,7 +299,7 @@ async function getFetchOptions(
|
|||
|
||||
const fetchOptions = {
|
||||
method: options.type,
|
||||
body: options.data,
|
||||
body: typeof options.data === 'function' ? options.data() : options.data,
|
||||
headers: {
|
||||
'User-Agent': getUserAgent(options.version),
|
||||
'X-Signal-Agent': 'OWD',
|
||||
|
@ -1303,7 +1303,7 @@ export type WebAPIType = {
|
|||
elements: VerifyServiceIdRequestType
|
||||
) => Promise<VerifyServiceIdResponseType>;
|
||||
putEncryptedAttachment: (
|
||||
encryptedBin: Uint8Array | Readable,
|
||||
encryptedBin: Uint8Array | (() => Readable),
|
||||
uploadForm: AttachmentV3ResponseType
|
||||
) => Promise<void>;
|
||||
putProfile: (
|
||||
|
@ -3530,7 +3530,7 @@ export function initialize({
|
|||
}
|
||||
|
||||
async function putEncryptedAttachment(
|
||||
encryptedBin: Uint8Array | Readable,
|
||||
encryptedBin: Uint8Array | (() => Readable),
|
||||
uploadForm: AttachmentV3ResponseType
|
||||
) {
|
||||
const { signedUploadLocation, headers } = uploadForm;
|
||||
|
|
|
@ -146,7 +146,7 @@ export async function uploadFile({
|
|||
});
|
||||
} else {
|
||||
await server.putEncryptedAttachment(
|
||||
createReadStream(absoluteCiphertextPath),
|
||||
() => createReadStream(absoluteCiphertextPath),
|
||||
uploadForm
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue