瀏覽代碼

Update doc for the `HTTP_METHOD_SPECIFY` property item (#1091)

master
于玉桔 Eric Zhao 5 年之前
父節點
當前提交
b6c2979cee
共有 3 個文件被更改,包括 4 次插入3 次删除
  1. +2
    -1
      sentinel-adapter/sentinel-web-servlet/README.md
  2. +1
    -1
      sentinel-adapter/sentinel-web-servlet/src/main/java/com/alibaba/csp/sentinel/adapter/servlet/CommonFilter.java
  3. +1
    -1
      sentinel-adapter/sentinel-web-servlet/src/test/java/com/alibaba/csp/sentinel/adapter/servletmethod/FilterMethodConfig.java

+ 2
- 1
sentinel-adapter/sentinel-web-servlet/README.md 查看文件

@@ -39,7 +39,8 @@ public class FilterConfig {
registration.addUrlPatterns("/*");
registration.setName("sentinelCommonFilter");
registration.setOrder(1);

// Set whether to support the specified HTTP method for the filter.
registration.addInitParameter(CommonFilter.HTTP_METHOD_SPECIFY, "false");
return registration;
}
}


+ 1
- 1
sentinel-adapter/sentinel-web-servlet/src/main/java/com/alibaba/csp/sentinel/adapter/servlet/CommonFilter.java 查看文件

@@ -48,7 +48,7 @@ import com.alibaba.csp.sentinel.util.StringUtil;
*/
public class CommonFilter implements Filter {

private final static String HTTP_METHOD_SPECIFY = "HTTP_METHOD_SPECIFY";
public final static String HTTP_METHOD_SPECIFY = "HTTP_METHOD_SPECIFY";
/**
* Use the path of the url as the context, if necessary, but pay attention to the number of context EntranceNode
*/


+ 1
- 1
sentinel-adapter/sentinel-web-servlet/src/test/java/com/alibaba/csp/sentinel/adapter/servletmethod/FilterMethodConfig.java 查看文件

@@ -16,7 +16,7 @@ public class FilterMethodConfig {
FilterRegistrationBean registration = new FilterRegistrationBean();
registration.setFilter(new CommonFilter());
registration.addUrlPatterns("/*");
registration.addInitParameter("HTTP_METHOD_SPECIFY", "true");
registration.addInitParameter(CommonFilter.HTTP_METHOD_SPECIFY, "true");
registration.setName("sentinelFilter");
registration.setOrder(1);



Loading…
取消
儲存