feat(REST): append additional information to the required User Agent (#6112)

Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
This commit is contained in:
Joey Smalen
2021-07-16 13:27:12 +02:00
committed by GitHub
parent 8db6df3d1e
commit f200f14a40
4 changed files with 15 additions and 2 deletions

View File

@@ -520,6 +520,9 @@ class Client extends BaseClient {
if (typeof options.failIfNotExists !== 'boolean') {
throw new TypeError('CLIENT_INVALID_OPTION', 'failIfNotExists', 'a boolean');
}
if (!Array.isArray(options.userAgentSuffix)) {
throw new TypeError('CLIENT_INVALID_OPTION', 'userAgentSuffix', 'an array of strings');
}
if (
typeof options.rejectOnRateLimit !== 'undefined' &&
!(typeof options.rejectOnRateLimit === 'function' || Array.isArray(options.rejectOnRateLimit))