chore: update axios

This commit is contained in:
Adhiraj Singh
2023-02-18 12:34:04 +05:30
parent b2c1cfbf9c
commit f013b61e35
6 changed files with 816 additions and 792 deletions

View File

@@ -1,3 +1,4 @@
import { AxiosRequestConfig } from 'axios'
import { Logger } from 'pino'
import { WAMediaUploadFunction, WAUrlInfo } from '../Types'
import { prepareWAMessageMedia } from './messages'
@@ -21,7 +22,7 @@ export type URLGenerationOptions = {
/** Timeout in ms */
timeout: number
proxyUrl?: string
headers?: { [key: string]: string }
headers?: AxiosRequestConfig<{}>['headers']
}
uploadImage?: WAMediaUploadFunction
logger?: Logger
@@ -47,7 +48,10 @@ export const getUrlInfo = async(
previewLink = 'https://' + previewLink
}
const info = await getLinkPreview(previewLink, opts.fetchOpts)
const info = await getLinkPreview(previewLink, {
...opts.fetchOpts,
headers: opts.fetchOpts as {}
})
if(info && 'title' in info && info.title) {
const [image] = info.images