Skip to content

Commit

Permalink
Add EnableNormalizing to RequestHeader and ResponseHeader
Browse files Browse the repository at this point in the history
  • Loading branch information
erikdubbelboer committed Aug 16, 2020
1 parent cc8ba4b commit a995d43
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions header.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit a995d43

Please sign in to comment.