|
20 | 20 |
|
21 | 21 | import com.microsoft.playwright.impl.PlaywrightImpl; |
22 | 22 |
|
23 | | -import java.io.OutputStreamWriter; |
24 | | -import java.io.Writer; |
25 | 23 | import java.util.HashMap; |
26 | 24 | import java.util.concurrent.ExecutionException; |
27 | 25 | import java.util.concurrent.Future; |
@@ -210,25 +208,16 @@ Pattern globToRegex(String glob, String baseURL, boolean webSocketUrl) { |
210 | 208 | return ((PlaywrightImpl) playwright).localUtils().globToRegex(glob, baseURL, webSocketUrl); |
211 | 209 | } |
212 | 210 |
|
213 | | - boolean urlMatches(String baseURL, String urlString, Object match) { |
214 | | - return urlMatches(baseURL, urlString, match, false); |
215 | | - } |
216 | | - |
217 | | - boolean urlMatches(String baseURL, String urlString, Object match, boolean webSocketUrl) { |
| 211 | + boolean urlMatches(String baseURL, String urlString, String match) { |
218 | 212 | if (match == null) { |
219 | 213 | return true; |
220 | 214 | } |
221 | 215 |
|
222 | | - if (match instanceof String) { |
223 | | - String glob = (String) match; |
224 | | - if (glob.isEmpty()) { |
225 | | - return true; |
226 | | - } |
227 | | - |
228 | | - match = globToRegex(glob, baseURL, webSocketUrl); |
| 216 | + String glob = (String) match; |
| 217 | + if (glob.isEmpty()) { |
| 218 | + return true; |
229 | 219 | } |
230 | 220 |
|
231 | | - Pattern pattern = (Pattern) match; |
232 | | - return pattern.matcher(urlString).find(); |
| 221 | + return globToRegex(glob, baseURL, false).matcher(urlString).find(); |
233 | 222 | } |
234 | 223 | } |
0 commit comments