This commit is contained in:
Adhiraj
2020-09-23 18:39:32 +05:30
parent d86cde2805
commit f3ecbb11a0
2 changed files with 20 additions and 15 deletions

View File

@@ -360,11 +360,11 @@ export class WAConnection extends EventEmitter {
/**
* Does a fetch request with the configuration of the connection
*/
protected fetchRequest = (endpoint: string, method: string = 'GET', body?: any, agent?: Agent) => (
protected fetchRequest = (endpoint: string, method: string = 'GET', body?: any, agent?: Agent, headers?: {[k: string]: string}) => (
fetch(endpoint, {
method,
body,
headers: { Origin: DEFAULT_ORIGIN },
headers: { Origin: DEFAULT_ORIGIN, ...(headers || {}) },
agent: agent || this.connectOptions.agent
})
)