File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
python-checks/src/main/java/org/sonar/python/checks/hotspots Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 1717package org .sonar .python .checks .hotspots ;
1818
1919import java .net .MalformedURLException ;
20+ import java .net .URI ;
21+ import java .net .URISyntaxException ;
2022import java .net .URL ;
2123import java .util .Collection ;
2224import java .util .Collections ;
@@ -270,12 +272,12 @@ private static boolean isURLWithCredentials(StringLiteral stringLiteral) {
270272 return false ;
271273 }
272274 try {
273- URL url = new URL (stringLiteral .trimmedQuotesValue ());
275+ URL url = new URI (stringLiteral .trimmedQuotesValue ()). toURL ( );
274276 String userInfo = url .getUserInfo ();
275277 if (userInfo != null && userInfo .matches ("\\ S+:\\ S+" )) {
276278 return true ;
277279 }
278- } catch (MalformedURLException e ) {
280+ } catch (URISyntaxException | MalformedURLException | IllegalArgumentException e ) {
279281 return false ;
280282 }
281283 return false ;
You can’t perform that action at this time.
0 commit comments