Add support to change the user agent.
This commit is contained in:
@@ -183,6 +183,11 @@ export function get(config: IConfig, options: string|request.Options, done: (err
|
||||
loadCookies(config);
|
||||
}
|
||||
|
||||
if (config.userAgent)
|
||||
{
|
||||
defaultHeaders['User-Agent'] = config.userAgent;
|
||||
}
|
||||
|
||||
authenticate(config, (err) =>
|
||||
{
|
||||
if (err)
|
||||
@@ -209,6 +214,11 @@ export function post(config: IConfig, options: request.Options, done: (err: Erro
|
||||
loadCookies(config);
|
||||
}
|
||||
|
||||
if (config.userAgent)
|
||||
{
|
||||
defaultHeaders['User-Agent'] = config.userAgent;
|
||||
}
|
||||
|
||||
authenticate(config, (err) =>
|
||||
{
|
||||
if (err)
|
||||
@@ -375,7 +385,6 @@ function authenticate(config: IConfig, done: (err: Error) => void)
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user