diff --git a/lib/basedriver/desired-caps.js b/lib/basedriver/desired-caps.js index 112a0ca26..a95dafb51 100755 --- a/lib/basedriver/desired-caps.js +++ b/lib/basedriver/desired-caps.js @@ -109,6 +109,17 @@ validator.validators.isObject = function isObject (value) { return 'must be of type object'; }; +validator.validators.isArray = function isArray (value) { + if (Array.isArray(value)) { + return null; + } + + if (typeof value === 'undefined') { + return null; + } + + return 'must be of type array'; +}; validator.validators.deprecated = function deprecated (value, options, key) { if (options) { log.warn(`${key} is a deprecated capability`); diff --git a/lib/jsonwp-proxy/proxy.js b/lib/jsonwp-proxy/proxy.js index 6c23b7d1c..029e71594 100644 --- a/lib/jsonwp-proxy/proxy.js +++ b/lib/jsonwp-proxy/proxy.js @@ -159,6 +159,7 @@ class JWProxy { const resBodyObj = util.safeJsonParse(resBody); if (!this.downstreamProtocol) { this.downstreamProtocol = this.getProtocolFromResBody(resBodyObj); + log.debug(`Determined that the downstream protocol for proxy is ${this.downstreamProtocol}`); } if (res.statusCode < 400 && this.downstreamProtocol === MJSONWP && parseInt(resBodyObj.status, 10) !== 0) { // Some servers, like chromedriver may return response code 200 for non-zero JSONWP statuses