I have a BackendConfig with headers like such:
version: cloud.google.com/v1
kind: BackendConfig
metadata:
name: name
namespace: ns
spec:
customResponseHeaders:
headers:
- "Content-Security-Policy-Report-Only: default-src 'self'; report-uri https://o250588.ingest.us.sentry.io/api/xxx/security/?sentry_key=yyy; report-to csp-endpoint"
- "Report-To: {'group':'csp-endpoint', 'max_age':10886400, 'endpoints': [{'url':'https://o250588.ingest.us.sentry.io/api/zzz/security/?sentry_key=yyy'}], 'include_subdomains':true}"
When this BackendConfig is applied I see the following error in the gce_backend_service:
Invalid value for field ‘resource.customResponseHeaders[1]’: ‘Report-To: {‘group’:’csp-endpoint’, ‘max_age’:10886400, ‘endpoints’:[{‘url’:’https://o250588.ingest.us.sentry.io/api/zzz/security/?sentry_key=yyy’}], ‘include_subdomains’:true}’. Missing closing brace ‘}’ in header field value.
The closing brace is not missing, it’s at the end of the string. Maybe it should be escaped or so?
I’ve tried using multiline YAML and quoting the JSON in single quotes and the rest in doubles, but if the YAML is valid I get the same error about the “missing closing brace”.
How can I add the Report-To header with the JSON to a GCP BackendConfig?