Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.

Commit

Permalink
Merge pull request #314 from appium/jlipps/misc
Browse files Browse the repository at this point in the history
add isArray to cap validation strategies
  • Loading branch information
jlipps authored Apr 4, 2019
2 parents b0d7e2e + 2fd5db2 commit 15d99fc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/basedriver/desired-caps.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`);
Expand Down
1 change: 1 addition & 0 deletions lib/jsonwp-proxy/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 15d99fc

Please sign in to comment.