diff --git a/header.go b/header.go index 59d0165b39..e13f6852db 100644 --- a/header.go +++ b/header.go @@ -585,6 +585,22 @@ func (h *RequestHeader) DisableNormalizing() { h.disableNormalizing = true } +// EnableNormalizing enables header names' normalization. +// +// Header names are normalized by uppercasing the first letter and +// all the first letters following dashes, while lowercasing all +// the other letters. +// Examples: +// +// * CONNECTION -> Connection +// * conteNT-tYPE -> Content-Type +// * foo-bar-baz -> Foo-Bar-Baz +// +// This is enabled by default unless disabled using DisableNormalizing() +func (h *RequestHeader) EnableNormalizing() { + h.disableNormalizing = false +} + // DisableNormalizing disables header names' normalization. // // By default all the header names are normalized by uppercasing @@ -601,6 +617,22 @@ func (h *ResponseHeader) DisableNormalizing() { h.disableNormalizing = true } +// EnableNormalizing enables header names' normalization. +// +// Header names are normalized by uppercasing the first letter and +// all the first letters following dashes, while lowercasing all +// the other letters. +// Examples: +// +// * CONNECTION -> Connection +// * conteNT-tYPE -> Content-Type +// * foo-bar-baz -> Foo-Bar-Baz +// +// This is enabled by default unless disabled using DisableNormalizing() +func (h *ResponseHeader) EnableNormalizing() { + h.disableNormalizing = false +} + // SetNoDefaultContentType allows you to control if a default Content-Type header will be set (false) or not (true). func (h *ResponseHeader) SetNoDefaultContentType(noDefaultContentType bool) { h.noDefaultContentType = noDefaultContentType