Skip to content

Commit 85a4666

Browse files
committed
fix handling of excluding all query string parameters from page rules
1 parent b3bd601 commit 85a4666

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

internal/app/cf-terraforming/cmd/generate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ func generateResources() func(cmd *cobra.Command, args []string) {
662662
// Remap cache_key_fields.query_string.include & .exclude wildcards (not in an array) to the appropriate "ignore" field value in Terraform.
663663
if c, ok := jsonStructData[i].(map[string]interface{})["actions"].(map[string]interface{})["cache_key_fields"].(map[string]interface{}); ok {
664664
if s, sok := c["query_string"].(map[string]interface{})["include"].(string); sok && s == "*" {
665-
jsonStructData[i].(map[string]interface{})["actions"].(map[string]interface{})["cache_key_fields"].(map[string]interface{})["query_string"].(map[string]interface{})["include"] = []interface{}{}
665+
jsonStructData[i].(map[string]interface{})["actions"].(map[string]interface{})["cache_key_fields"].(map[string]interface{})["query_string"].(map[string]interface{})["include"] = nil
666666
jsonStructData[i].(map[string]interface{})["actions"].(map[string]interface{})["cache_key_fields"].(map[string]interface{})["query_string"].(map[string]interface{})["ignore"] = false
667667
}
668668
if s, sok := c["query_string"].(map[string]interface{})["exclude"].(string); sok && s == "*" {

testdata/cloudflare/cloudflare_page_rule.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ interactions:
4646
},
4747
"query_string": {
4848
"include": [],
49-
"exclude": [
50-
"*"
51-
]
49+
"exclude": "*"
5250
},
5351
"host": {
5452
"resolved": true

0 commit comments

Comments
 (0)