mirror of
https://github.com/yushijinhun/authlib-injector.git
synced 2024-11-14 22:01:16 +01:00
optimize url matching
This commit is contained in:
parent
cfbfc7f5ba
commit
45ca1e0f84
1 changed files with 4 additions and 0 deletions
|
@ -68,6 +68,10 @@ public class URLProcessor {
|
|||
* @return the transformed URL, or empty if it doesn't need to be transformed
|
||||
*/
|
||||
public Optional<String> transformURL(String inputUrl) {
|
||||
if (!inputUrl.startsWith("http")) {
|
||||
// fast path
|
||||
return Optional.empty();
|
||||
}
|
||||
Matcher matcher = URL_REGEX.matcher(inputUrl);
|
||||
if (!matcher.find()) {
|
||||
return Optional.empty();
|
||||
|
|
Loading…
Reference in a new issue