diff --git a/src/main/java/gyro/google/compute/BackendServiceCdnCacheKeyPolicy.java b/src/main/java/gyro/google/compute/BackendServiceCdnCacheKeyPolicy.java index 2eeb295a..f04eeb3f 100644 --- a/src/main/java/gyro/google/compute/BackendServiceCdnCacheKeyPolicy.java +++ b/src/main/java/gyro/google/compute/BackendServiceCdnCacheKeyPolicy.java @@ -33,6 +33,7 @@ public class BackendServiceCdnCacheKeyPolicy extends Diffable implements Copyabl private Boolean includeQueryString; private List queryStringBlacklist; private List queryStringWhitelist; + private List includeHttpHeaders; /** * If true, requests to different hosts will be cached separately. @@ -102,6 +103,22 @@ public void setQueryStringWhitelist(List queryStringWhitelist) { this.queryStringWhitelist = queryStringWhitelist; } + /** + * The HTTP request headers (by name) to be used in the cache key. + */ + @Updatable + public List getIncludeHttpHeaders() { + if (includeHttpHeaders == null) { + includeHttpHeaders = new ArrayList<>(); + } + + return includeHttpHeaders; + } + + public void setIncludeHttpHeaders(List includeHttpHeaders) { + this.includeHttpHeaders = includeHttpHeaders; + } + @Override public String primaryKey() { return ""; @@ -123,6 +140,7 @@ public void copyFrom(CacheKeyPolicy model) { setQueryStringBlacklist(model.getQueryStringBlacklistList()); setQueryStringWhitelist(model.getQueryStringWhitelistList()); + setIncludeHttpHeaders(model.getIncludeHttpHeadersList()); } CacheKeyPolicy toCacheKeyPolicy() { @@ -132,6 +150,7 @@ CacheKeyPolicy toCacheKeyPolicy() { .setIncludeQueryString(TRUE.equals(getIncludeQueryString())) .addAllQueryStringBlacklist(getQueryStringBlacklist()) .addAllQueryStringWhitelist(getQueryStringWhitelist()) + .addAllIncludeHttpHeaders(getIncludeHttpHeaders()) .build(); } }