diff --git a/web/src/main/java/org/openmrs/web/filter/GZIPFilter.java b/web/src/main/java/org/openmrs/web/filter/GZIPFilter.java index 1f3f22c4f6aa..83886055ced8 100644 --- a/web/src/main/java/org/openmrs/web/filter/GZIPFilter.java +++ b/web/src/main/java/org/openmrs/web/filter/GZIPFilter.java @@ -19,6 +19,7 @@ import org.openmrs.api.APIException; import org.openmrs.api.context.Context; import org.openmrs.util.OpenmrsConstants; +import org.openmrs.util.PrivilegeConstants; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.web.filter.OncePerRequestFilter; @@ -124,6 +125,8 @@ private boolean isGZIPEnabled() { } try { + Context.addProxyPrivilege(PrivilegeConstants.GET_GLOBAL_PROPERTIES); + String gzipEnabled = Context.getAdministrationService().getGlobalProperty( OpenmrsConstants.GLOBAL_PROPERTY_GZIP_ENABLED, ""); @@ -137,6 +140,9 @@ private boolean isGZIPEnabled() { return false; } + finally { + Context.removeProxyPrivilege(PrivilegeConstants.GET_GLOBAL_PROPERTIES); + } } /**