Skip to content

Commit 12a4db3

Browse files
committed
<fix>[lb]: intercept httpCompressAlgos::disable tag
Resolves: ZSTAC-81706 Change-Id: I6877637970626766686473657579617664657474 Signed-off-by: AlanJager <ye.zou@zstack.io>
1 parent b00e763 commit 12a4db3

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

plugin/loadBalancer/src/main/java/org/zstack/network/service/lb/LoadBalancerApiInterceptor.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -865,6 +865,14 @@ private void validate(APICreateLoadBalancerListenerMsg msg) {
865865
statusCode = LoadBalancerSystemTags.STATUS_CODE.getTokenByTag(tag,
866866
LoadBalancerSystemTags.STATUS_CODE_TOKEN);
867867
}
868+
if (LoadBalancerSystemTags.HTTP_COMPRESS_ALGOS.isMatch(tag)) {
869+
String compressAlgos = LoadBalancerSystemTags.HTTP_COMPRESS_ALGOS.getTokenByTag(tag,
870+
LoadBalancerSystemTags.HTTP_COMPRESS_ALGOS_TOKEN);
871+
if (DisableLbSupportHttpCompressAlgos.equals(compressAlgos)) {
872+
throw new ApiMessageInterceptionException(argerr(ORG_ZSTACK_NETWORK_SERVICE_LB_10172,
873+
"could not create the loadbalancer listener with systemTag httpCompressAlgos::disable, please remove this tag"));
874+
}
875+
}
868876
}
869877

870878
if ((redirectPort != null || statusCode != null) && (httpRedirectHttps == null || HttpRedirectHttps.disable.toString().equals(httpRedirectHttps))) {

utils/src/main/java/org/zstack/utils/clouderrorcode/CloudOperationsErrorCode.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13612,6 +13612,8 @@ public class CloudOperationsErrorCode {
1361213612

1361313613
public static final String ORG_ZSTACK_NETWORK_SERVICE_LB_10171 = "ORG_ZSTACK_NETWORK_SERVICE_LB_10171";
1361413614

13615+
public static final String ORG_ZSTACK_NETWORK_SERVICE_LB_10172 = "ORG_ZSTACK_NETWORK_SERVICE_LB_10172";
13616+
1361513617
public static final String ORG_ZSTACK_IPSEC_10000 = "ORG_ZSTACK_IPSEC_10000";
1361613618

1361713619
public static final String ORG_ZSTACK_IPSEC_10001 = "ORG_ZSTACK_IPSEC_10001";

0 commit comments

Comments
 (0)