mirror of
https://github.com/appium/appium.git
synced 2026-10-29 04:36:39 +08:00
Merge pull request #314 from appium/jlipps/misc
add isArray to cap validation strategies
This commit is contained in:
@@ -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`);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user