瀏覽代碼

use isHostname utility method

master
Jonathan Cobb 4 年之前
父節點
當前提交
507530784e
共有 1 個檔案被更改,包括 2 行新增2 行删除
  1. +2
    -2
      src/main/java/bubble/abp/BlockTarget.java

+ 2
- 2
src/main/java/bubble/abp/BlockTarget.java 查看文件

@@ -18,7 +18,7 @@ import static org.cobbzilla.util.daemon.ZillaRuntime.empty;
import static org.cobbzilla.util.http.HttpSchemes.stripScheme;
import static org.cobbzilla.util.json.JsonUtil.json;
import static org.cobbzilla.util.json.JsonUtil.jsonQuoteRegex;
import static org.cobbzilla.util.string.ValidationRegexes.HOST_PATTERN;
import static org.cobbzilla.util.string.ValidationRegexes.isHostname;

@NoArgsConstructor @Accessors(chain=true) @EqualsAndHashCode(of={"domainRegex", "regex"})
public class BlockTarget {
@@ -51,7 +51,7 @@ public class BlockTarget {
}

public static String hostOrNull(String hostPart) {
return HOST_PATTERN.matcher(hostPart).matches() ? hostPart : null;
return isHostname(hostPart) ? hostPart : null;
}

public static BlockTarget parseBubbleLine(String line) {


Loading…
取消
儲存