Skip to content

Commit

Permalink
fix(cachingFilter: Allow disabling the content caching filter (#1699) (
Browse files Browse the repository at this point in the history
…#1702)

* fix(cachingFilter: Allow disabling the content caching filter

* fix(cachingFilter: Allow disabling the content caching filter

(cherry picked from commit 7e403b0)

Co-authored-by: Jason <[email protected]>
  • Loading branch information
mergify[bot] and jasonmcintosh committed Sep 1, 2023
1 parent 92fa197 commit 431b73f
Showing 1 changed file with 4 additions and 0 deletions.
Expand Up @@ -23,6 +23,7 @@ import com.netflix.spinnaker.gate.interceptors.ResponseHeaderInterceptor
import com.netflix.spinnaker.gate.interceptors.ResponseHeaderInterceptorConfigurationProperties
import com.netflix.spinnaker.gate.retrofit.UpstreamBadRequest
import com.netflix.spinnaker.kork.dynamicconfig.DynamicConfigService
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import com.netflix.spinnaker.kork.web.interceptors.MetricsInterceptor
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.beans.factory.annotation.Value
Expand Down Expand Up @@ -80,7 +81,10 @@ public class GateWebConfig implements WebMvcConfigurer {
return new HandlerMappingIntrospector(context)
}


// Add the ability to disable as this breaks numerous integration patterns
@Bean
@ConditionalOnProperty(value = "content.cachingFilter.enabled", matchIfMissing = true)
Filter contentCachingFilter() {
// This filter simply buffers the response so that Content-Length header can be set
return new ContentCachingFilter()
Expand Down

0 comments on commit 431b73f

Please sign in to comment.