mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
sentinel HTTP_METHOD_SPECIFY
This commit is contained in:
@@ -92,6 +92,11 @@ public class SentinelProperties {
|
||||
*/
|
||||
private Log log = new Log();
|
||||
|
||||
/**
|
||||
* Add HTTP method prefix for Sentinel Resource.
|
||||
*/
|
||||
private Boolean httpMethodSpecify = false;
|
||||
|
||||
public boolean isEager() {
|
||||
return eager;
|
||||
}
|
||||
@@ -164,6 +169,14 @@ public class SentinelProperties {
|
||||
this.log = log;
|
||||
}
|
||||
|
||||
public Boolean getHttpMethodSpecify() {
|
||||
return httpMethodSpecify;
|
||||
}
|
||||
|
||||
public void setHttpMethodSpecify(Boolean httpMethodSpecify) {
|
||||
this.httpMethodSpecify = httpMethodSpecify;
|
||||
}
|
||||
|
||||
public static class Flow {
|
||||
|
||||
/**
|
||||
|
@@ -66,6 +66,8 @@ public class SentinelWebAutoConfiguration {
|
||||
Filter filter = new CommonFilter();
|
||||
registration.setFilter(filter);
|
||||
registration.setOrder(filterConfig.getOrder());
|
||||
registration.addInitParameter("HTTP_METHOD_SPECIFY",
|
||||
String.valueOf(properties.getHttpMethodSpecify()));
|
||||
log.info("[Sentinel Starter] register Sentinel with urlPatterns: {}.",
|
||||
filterConfig.getUrlPatterns());
|
||||
return registration;
|
||||
|
Reference in New Issue
Block a user