Support client request with / path

This commit is contained in:
hongqiaowei
2023-02-02 17:57:28 +08:00
parent 8368aa6c82
commit f513623030

View File

@@ -227,6 +227,9 @@ public abstract class WebUtils {
} else { } else {
if (gatewayPrefix.equals(prefix) || SystemConfig.DEFAULT_GATEWAY_TEST_PREFIX.equals(prefix)) { if (gatewayPrefix.equals(prefix) || SystemConfig.DEFAULT_GATEWAY_TEST_PREFIX.equals(prefix)) {
int trdFS = p.indexOf(Consts.S.FORWARD_SLASH, secFS + 1); int trdFS = p.indexOf(Consts.S.FORWARD_SLASH, secFS + 1);
if (trdFS == -1) {
trdFS = p.length();
}
svc = p.substring(secFS + 1, trdFS); svc = p.substring(secFS + 1, trdFS);
} else { } else {
throw Utils.runtimeExceptionWithoutStack("wrong prefix " + prefix); throw Utils.runtimeExceptionWithoutStack("wrong prefix " + prefix);
@@ -357,7 +360,11 @@ public abstract class WebUtils {
if (gatewayPrefix.equals(prefix) || SystemConfig.DEFAULT_GATEWAY_TEST_PREFIX.equals(prefix)) { if (gatewayPrefix.equals(prefix) || SystemConfig.DEFAULT_GATEWAY_TEST_PREFIX.equals(prefix)) {
int trdFS = p.indexOf(Consts.S.FORWARD_SLASH, secFS + 1); int trdFS = p.indexOf(Consts.S.FORWARD_SLASH, secFS + 1);
p = p.substring(trdFS); if (trdFS == -1) {
p = Consts.S.FORWARD_SLASH_STR;
} else {
p = p.substring(trdFS);
}
} else { } else {
throw Utils.runtimeExceptionWithoutStack("wrong prefix " + prefix); throw Utils.runtimeExceptionWithoutStack("wrong prefix " + prefix);
} }