File tree Expand file tree Collapse file tree
src/main/java/com/browserstack/local Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,6 +45,11 @@ class LocalBinary {
4545 System .getProperty ("java.io.tmpdir" )
4646 };
4747
48+ // Each guard below covers a case the final host-equals check does not:
49+ // - null/empty URL: new URL(null) throws NPE before the catch can run.
50+ // - MalformedURLException: convert raw JVM exception to LocalException for the public contract.
51+ // - HTTPS check: allowlist matches host only; without this, http://browserstack.com would pass.
52+ // - null/empty host: getHost() returns null for URLs like https:///foo, which NPEs on toLowerCase().
4853 private static String validateSourceUrl (String url ) throws LocalException {
4954 if (url == null || url .isEmpty ()) {
5055 throw new LocalException ("Refusing binary download: empty source URL" );
You can’t perform that action at this time.
0 commit comments