UrlProcessorSlotChain.java 661 B

12345678910111213141516171819
  1. package cn.nosum.gateway.slot.chain;
  2. import cn.nosum.common.exception.ExcludeException;
  3. import cn.nosum.gateway.slot.AbstractLinkedProcessorSlot;
  4. import cn.nosum.common.constant.CommonConstants;
  5. import cn.nosum.common.http.entity.Context;
  6. public class UrlProcessorSlotChain extends AbstractLinkedProcessorSlot<Context> {
  7. @Override
  8. public void exec(Context context) throws Throwable {
  9. String uri=context.getRequest().getUrl();
  10. // 过滤掉请求图标的地址
  11. if (uri.equals(CommonConstants.ICON_URL)) {
  12. throw new ExcludeException();
  13. }
  14. // 执行下一个过滤器
  15. fireExec(context);
  16. }
  17. }