Fix gateway prefix problem
This commit is contained in:
@@ -125,11 +125,17 @@ public class FlowControlFilter extends FizzWebFilter {
|
|||||||
|
|
||||||
String service = null;
|
String service = null;
|
||||||
if (!favReq) {
|
if (!favReq) {
|
||||||
int secFS = path.indexOf(Consts.S.FORWARD_SLASH, 1);
|
|
||||||
if (secFS == -1) {
|
String gatewayPrefix = systemConfig.getGatewayPrefix();
|
||||||
return WebUtils.responseError(exchange, HttpStatus.INTERNAL_SERVER_ERROR.value(), "request path should like /optional-prefix/service-name/real-biz-path");
|
if (StringUtils.isBlank(gatewayPrefix) || Consts.S.FORWARD_SLASH_STR.equals(gatewayPrefix)) {
|
||||||
|
service = Consts.S.FORWARD_SLASH_STR;
|
||||||
|
} else {
|
||||||
|
int secFS = path.indexOf(Consts.S.FORWARD_SLASH, 1);
|
||||||
|
if (secFS == -1) {
|
||||||
|
return WebUtils.responseError(exchange, HttpStatus.INTERNAL_SERVER_ERROR.value(), "request path should like /gateway-prefix/service-name/real-biz-path");
|
||||||
|
}
|
||||||
|
service = path.substring(1, secFS);
|
||||||
}
|
}
|
||||||
service = path.substring(1, secFS);
|
|
||||||
|
|
||||||
if (service.equals(admin) || service.equals(actuator)) {
|
if (service.equals(admin) || service.equals(actuator)) {
|
||||||
adminReq = true;
|
adminReq = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user