File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Source/library/src/main/java/im/delight/android/webview Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1106,8 +1106,12 @@ protected static String makeUrlUnique(final String url) {
11061106
11071107 return unique .toString ();
11081108 }
1109-
1109+
11101110 public boolean isPermittedUrl (final String url ) {
1111+ isPermittedUrl (url , true )
1112+ }
1113+
1114+ public boolean isPermittedUrl (final String url , boolean allowSubdomains ) {
11111115 // if the permitted hostnames have not been restricted to a specific set
11121116 if (mPermittedHostnames .size () == 0 ) {
11131117 // all hostnames are allowed
@@ -1142,7 +1146,7 @@ public boolean isPermittedUrl(final String url) {
11421146 // for every hostname in the set of permitted hosts
11431147 for (String expectedHost : mPermittedHostnames ) {
11441148 // if the two hostnames match or if the actual host is a subdomain of the expected host
1145- if (actualHost .equals (expectedHost ) || actualHost .endsWith ("." + expectedHost )) {
1149+ if (actualHost .equals (expectedHost ) || ( allowSubdomains && actualHost .endsWith ("." + expectedHost ) )) {
11461150 // the actual hostname of the URL to be checked is allowed
11471151 return true ;
11481152 }
You can’t perform that action at this time.
0 commit comments