mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
fix: use fetchAgent for uploading data
This commit is contained in:
@@ -461,7 +461,7 @@ export function extensionForMediaMessage(message: WAMessageContent) {
|
|||||||
return extension
|
return extension
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getWAUploadToServer = ({ customUploadHosts, agent, logger }: CommonSocketConfig<any>, refreshMediaConn: (force: boolean) => Promise<MediaConnInfo>): WAMediaUploadFunction => {
|
export const getWAUploadToServer = ({ customUploadHosts, fetchAgent, logger }: CommonSocketConfig<any>, refreshMediaConn: (force: boolean) => Promise<MediaConnInfo>): WAMediaUploadFunction => {
|
||||||
return async(stream, { mediaType, fileEncSha256B64, timeoutMs }) => {
|
return async(stream, { mediaType, fileEncSha256B64, timeoutMs }) => {
|
||||||
const { default: got } = await import('got')
|
const { default: got } = await import('got')
|
||||||
// send a query JSON to obtain the url & auth token to upload our media
|
// send a query JSON to obtain the url & auth token to upload our media
|
||||||
@@ -482,7 +482,7 @@ export const getWAUploadToServer = ({ customUploadHosts, agent, logger }: Common
|
|||||||
'Origin': DEFAULT_ORIGIN
|
'Origin': DEFAULT_ORIGIN
|
||||||
},
|
},
|
||||||
agent: {
|
agent: {
|
||||||
https: agent
|
https: fetchAgent
|
||||||
},
|
},
|
||||||
body: stream,
|
body: stream,
|
||||||
timeout: timeoutMs
|
timeout: timeoutMs
|
||||||
|
|||||||
Reference in New Issue
Block a user