Skip to content

Commit 4fa3884

Browse files
committed
chore: update validations forgeolocation to support state codes
1 parent 44bef5e commit 4fa3884

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bin/helpers/capabilityHelper.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ const validate = (bsConfig, args) => {
183183

184184
if( Utils.searchForOption('--async') && ( !Utils.isUndefined(args.async) && bsConfig["connection_settings"]["local"])) reject(Constants.validationMessages.INVALID_LOCAL_ASYNC_ARGS);
185185

186-
if (bsConfig.run_settings.userProvidedGeolocation && !(bsConfig.run_settings.geolocation.match(/^[A-Z]{2}$/g) || bsConfig.run_settings.geolocation.match(/^[A-Z]{2}-[A-Z1-9]+$/g)) ) reject(Constants.validationMessages.INVALID_GEO_LOCATION);
186+
if (bsConfig.run_settings.userProvidedGeolocation && !bsConfig.run_settings.geolocation.match(/^[A-Z]{2}(-[A-Z0-9]{2,3})?$/g)) reject(Constants.validationMessages.INVALID_GEO_LOCATION);
187187

188188
if (bsConfig["connection_settings"]["local"] && bsConfig.run_settings.userProvidedGeolocation) reject(Constants.validationMessages.NOT_ALLOWED_GEO_LOCATION_AND_LOCAL_MODE);
189189

0 commit comments

Comments
 (0)