Class SaFirewallCheckHookForHost

java.lang.Object
cn.dev33.satoken.strategy.hooks.SaFirewallCheckHookForHost
All Implemented Interfaces:
SaFirewallCheckHook

public class SaFirewallCheckHookForHost extends Object implements SaFirewallCheckHook
防火墙策略校验钩子函数:Host 检测
Since:
1.41.0
Author:
click33
  • Field Details

    • instance

      public static SaFirewallCheckHookForHost instance
      默认实例
    • isCheckHost

      public boolean isCheckHost
      是否校验 host,默认关闭
    • allowHosts

      public List<String> allowHosts
      允许的 host 列表,允许通配符
  • Constructor Details

    • SaFirewallCheckHookForHost

      public SaFirewallCheckHookForHost()
  • Method Details

    • resetConfig

      public void resetConfig(boolean isCheckHost, String... allowHosts)
      重载配置
      Parameters:
      isCheckHost - 是否校验 host
      allowHosts - 允许的 host 列表 (先清空原来的,再添加上新的)
    • execute

      public void execute(SaRequest req, SaResponse res, Object extArg)
      执行的方法
      Specified by:
      execute in interface SaFirewallCheckHook
      Parameters:
      req - 请求对象
      res - 响应对象
      extArg - 预留扩展参数