@paypal/sdk-client
Advanced tools
Comparing version 4.0.65 to 4.0.66
{ | ||
"name": "@paypal/sdk-client", | ||
"version": "4.0.65", | ||
"version": "4.0.66", | ||
"description": "Shared config between PayPal/Braintree.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -21,4 +21,2 @@ "use strict"; | ||
function validatePaymentsSDKUrl({ | ||
protocol, | ||
hostname, | ||
pathname, | ||
@@ -28,12 +26,2 @@ query, | ||
}) { | ||
if (hostname === _constants.HOST.LOCALHOST) { | ||
if (protocol !== _constants.PROTOCOL.HTTP && protocol !== _constants.PROTOCOL.HTTPS) { | ||
throw new Error(`Expected protocol for sdk url to be ${_constants.PROTOCOL.HTTP} or ${_constants.PROTOCOL.HTTPS} for host: ${hostname} - got ${protocol || 'undefined'}`); | ||
} | ||
} else { | ||
if (protocol !== _constants.PROTOCOL.HTTPS) { | ||
throw new Error(`Expected protocol for sdk url to be ${_constants.PROTOCOL.HTTPS} for host: ${hostname} - got ${protocol || 'undefined'}`); | ||
} | ||
} | ||
if (pathname !== _sdkConstants.SDK_PATH) { | ||
@@ -113,2 +101,12 @@ throw new Error(`Invalid path for sdk url: ${pathname || 'undefined'}`); | ||
if (hostname === _constants.HOST.LOCALHOST) { | ||
if (protocol !== _constants.PROTOCOL.HTTP && protocol !== _constants.PROTOCOL.HTTPS) { | ||
throw new Error(`Expected protocol for sdk url to be ${_constants.PROTOCOL.HTTP} or ${_constants.PROTOCOL.HTTPS} for host: ${hostname} - got ${protocol || 'undefined'}`); | ||
} | ||
} else { | ||
if (protocol !== _constants.PROTOCOL.HTTPS) { | ||
throw new Error(`Expected protocol for sdk url to be ${_constants.PROTOCOL.HTTPS} for host: ${hostname} - got ${protocol || 'undefined'}`); | ||
} | ||
} | ||
if (isLegacySDKUrl(hostname, pathname)) { | ||
@@ -115,0 +113,0 @@ validateLegacySDKUrl({ |
@@ -17,13 +17,3 @@ /* @flow */ | ||
function validatePaymentsSDKUrl({ protocol, hostname, pathname, query, hash }) { | ||
if (hostname === HOST.LOCALHOST) { | ||
if (protocol !== PROTOCOL.HTTP && protocol !== PROTOCOL.HTTPS) { | ||
throw new Error(`Expected protocol for sdk url to be ${ PROTOCOL.HTTP } or ${ PROTOCOL.HTTPS } for host: ${ hostname } - got ${ protocol || 'undefined' }`); | ||
} | ||
} else { | ||
if (protocol !== PROTOCOL.HTTPS) { | ||
throw new Error(`Expected protocol for sdk url to be ${ PROTOCOL.HTTPS } for host: ${ hostname } - got ${ protocol || 'undefined' }`); | ||
} | ||
} | ||
function validatePaymentsSDKUrl({ pathname, query, hash }) { | ||
@@ -98,2 +88,12 @@ if (pathname !== SDK_PATH) { | ||
if (hostname === HOST.LOCALHOST) { | ||
if (protocol !== PROTOCOL.HTTP && protocol !== PROTOCOL.HTTPS) { | ||
throw new Error(`Expected protocol for sdk url to be ${ PROTOCOL.HTTP } or ${ PROTOCOL.HTTPS } for host: ${ hostname } - got ${ protocol || 'undefined' }`); | ||
} | ||
} else { | ||
if (protocol !== PROTOCOL.HTTPS) { | ||
throw new Error(`Expected protocol for sdk url to be ${ PROTOCOL.HTTPS } for host: ${ hostname } - got ${ protocol || 'undefined' }`); | ||
} | ||
} | ||
if (isLegacySDKUrl(hostname, pathname)) { | ||
@@ -100,0 +100,0 @@ validateLegacySDKUrl({ pathname }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
58945
1085