From 98e7d98bdbcc31ab61b5864aebf91c9e4020ce16 Mon Sep 17 00:00:00 2001 From: bharathappali Date: Tue, 2 May 2023 15:59:20 +0530 Subject: [PATCH] Set Allow private network to true Signed-off-by: bharathappali --- src/main/java/com/autotune/utils/KruizeConstants.java | 9 +++++++++ .../java/com/autotune/utils/filter/KruizeCORSFilter.java | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/src/main/java/com/autotune/utils/KruizeConstants.java b/src/main/java/com/autotune/utils/KruizeConstants.java index 0b426c140..de21ec82b 100644 --- a/src/main/java/com/autotune/utils/KruizeConstants.java +++ b/src/main/java/com/autotune/utils/KruizeConstants.java @@ -331,6 +331,15 @@ public static class CORSConstants { public static final String ALLOWED_METHODS = "POST, GET"; public static final String ALLOWED_HEADERS = "X-PINGOTHER, Origin, X-Requested-With, Content-Type, Accept"; public static final String MAX_AGE = "1728000"; + public static final String ALLOW_PRIVATE_NETWORKS = "true"; + + public static class FilterParam { + + public static final String ACCESS_CONTROL_ALLOW_PRIVATE_NETWORK = "Access-Control-Allow-Private-Network"; + private FilterParam() { + + } + } private CORSConstants() { diff --git a/src/main/java/com/autotune/utils/filter/KruizeCORSFilter.java b/src/main/java/com/autotune/utils/filter/KruizeCORSFilter.java index d415e312e..e21356388 100644 --- a/src/main/java/com/autotune/utils/filter/KruizeCORSFilter.java +++ b/src/main/java/com/autotune/utils/filter/KruizeCORSFilter.java @@ -55,6 +55,10 @@ public static FilterHolder getFilter() { CrossOriginFilter.ACCESS_CONTROL_MAX_AGE_HEADER, KruizeConstants.CORSConstants.MAX_AGE ); + filterParams.put( + KruizeConstants.CORSConstants.FilterParam.ACCESS_CONTROL_ALLOW_PRIVATE_NETWORK, + KruizeConstants.CORSConstants.ALLOW_PRIVATE_NETWORKS + ); filterHolder.setInitParameters(filterParams); } return filterHolder;