Go

Go

Made by DeepSource

Redundant call to net/http.CanonicalHeaderKey in method call on net/http.Header SCC-S1035

Anti-pattern
Major
Autofix

The methods on net/http.Header, namely Add, Del, Get and Set, already canonicalize the given header name. Hence, there is no need to call the http.CanonicalHeaderKey function for these headers.

Bad practice

headers.Add(http.CanonicalHeaderKey("test"), "test")

Recommended

headers.Add("test", "test")