Changes to how underscores are handled in Transform Rules/HTTP Response header modification rules - read more

On the 17th February 2022 Cloudflare made a change to how Transform Rules treats HTTP response headers containing an underscore in the name.

Previously, Transform Rules with an action of ‘Set/’ and a HTTP header name containing an underscore will return a HTTP header to the browser where the underscores are converted to hyphens. For example, a custom response header with the name ‘visitor_country_code’ would be observed by the client with the header name ‘visitor-country-code’.

Yesterday we made a change to the code resulting in Transform Rules/HTTP Response Header Modification rules respecting underscores within the header name. This means Transform Rules will now begin removing origin-set HTTP headers containing an underscore if such a rule existed, and HTTP response headers set in Transform Rules containing an underscore will be sent to the client as specified, i.e. with underscores in tact.

If you wish to continue seeing the HTTP response header names with hyphens in place of underscores we advise you to update the Transform Rules affected and replace the underscores with hyphens before saving.

If no changes are made then the names of the HTTP response headers will change and begin returning underscores as specified.

If you have any questions, please create a new topic and we can help.

Sam Marsh
Group Product Manager - Edge/CDN