> What do you guys do? Do you think it's necessary to update the headers
> sent as long as the clients are case insensitive?
Per RFC 2068 section 4.2, HTTP/1.1 headers are case insensitive. So
unless your HTTP clients don't conform to RFC 2068, I wouldn't worry
about it. Even then, you should probably just update the clients to be
compliant.
> Is there a way I could "easily" lowercase all the HTTP headers I send?
>
> e.g.
> w.Header().Set("x-sync-token", csrf.Token(r))
> Will be sent as *X-Sync-Token*
net/http uses the CanonicalHeaderKey function which sets the casing of
the headers:
https://golang.org/pkg/net/http/#CanonicalHeaderKey
However, http.Header is just map[string][]string, so you could probably
just manipulate the map directly instead of using Set(). But the
built-in functions rely on CanonicalHeaderKey's casing, so you won't be
able to mix and match map manipulation with using Get/Set/Has.
I would just let Go send headers according to CanonicalHeaderKey and let
the GCP load balancer/proxy set the casing, as it shouldn't matter.