Headers case insensitivity (Vary, Accept-Encoding)


#1

I know that the header spec calls for headers to be treated in a case-insensitive manner, but some of the out-of-the-box handling in fastly’s vcl doesn’t quite line up with that. We have a node a node backend for one fastly endpoint, and apparently node insists on lowercasing all headers.

Fastly’s default gzip policy ends up patching the Vary header if the backend response doesn’t include “Accept-Encoding” in the Vary header. The node app server (hapi) is adding “accept-encoding” to the “vary” header, since it only thinks of headers as all lowercase…and fastly’s generated gzip regex is doing a case-sensitive search for the mixed-case variant. That leaves us with responses that look a bit odd when the final Vary header has “accept-encoding, Accept-Encoding”.

The oddity doesn’t bother me as much as my uncertainty as to how varnish ends up handling this scenario. Thoughts?