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

This commit is contained in:
于玉桔 2019-11-06 15:20:43 +08:00 committed by Eric Zhao
parent 7c2c137f6f
commit b6c2979cee
3 changed files with 4 additions and 3 deletions

View File

@ -39,7 +39,8 @@ public class FilterConfig {
registration.addUrlPatterns("/*"); registration.addUrlPatterns("/*");
registration.setName("sentinelCommonFilter"); registration.setName("sentinelCommonFilter");
registration.setOrder(1); registration.setOrder(1);
// Set whether to support the specified HTTP method for the filter.
registration.addInitParameter(CommonFilter.HTTP_METHOD_SPECIFY, "false");
return registration; return registration;
} }
} }

View File

@ -48,7 +48,7 @@ import com.alibaba.csp.sentinel.util.StringUtil;
*/ */
public class CommonFilter implements Filter { 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 * Use the path of the url as the context, if necessary, but pay attention to the number of context EntranceNode
*/ */

View File

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