aboutsummaryrefslogtreecommitdiff
path: root/header.go
diff options
context:
space:
mode:
authorGravatar Aoang <aoang@x2oe.com> 2022-08-14 17:31:57 +0800
committerGravatar GitHub <noreply@github.com> 2022-08-14 11:31:57 +0200
commitea6052464e7221956dedf9b9a523f8f9892c3d3b (patch)
tree089ef1b083c7d9edc7d54bc2485b1a564a2cc368 /header.go
parentImprove Client timeout (#1346) (diff)
downloadfasthttp-ea6052464e7221956dedf9b9a523f8f9892c3d3b.tar.gz
fasthttp-ea6052464e7221956dedf9b9a523f8f9892c3d3b.tar.bz2
fasthttp-ea6052464e7221956dedf9b9a523f8f9892c3d3b.zip
Add Go 1.19 Support (#1355)v1.39.0
* Update Go Version to Go1.19.x And add cache * Fix CI Line endings * Update test CI Go Version to Go1.19.x And add cache * Update Gosec Security Scanner CI to securego/gosec@v2.12.0 * Format comment Go 1.19 adds support for links, lists, and clearer headings in doc comments. As part of this change, gofmt now reformats doc comments to make their rendered meaning clearer. See “Go Doc Comments” for syntax details and descriptions of common mistakes now highlighted by gofmt. As another part of this change, the new package go/doc/comment provides parsing and reformatting of doc comments as well as support for rendering them to HTML, Markdown, and text. ref: https://tip.golang.org/doc/go1.19 ref: https://tip.golang.org/doc/comment * Fix doc structure
Diffstat (limited to 'header.go')
-rw-r--r--header.go68
1 files changed, 34 insertions, 34 deletions
diff --git a/header.go b/header.go
index 323b3f0..4c3c0ea 100644
--- a/header.go
+++ b/header.go
@@ -109,8 +109,8 @@ func (h *ResponseHeader) SetContentRange(startPos, endPos, contentLength int) {
// SetByteRange sets 'Range: bytes=startPos-endPos' header.
//
-// * If startPos is negative, then 'bytes=-startPos' value is set.
-// * If endPos is negative, then 'bytes=startPos-' value is set.
+// - If startPos is negative, then 'bytes=-startPos' value is set.
+// - If endPos is negative, then 'bytes=startPos-' value is set.
func (h *RequestHeader) SetByteRange(startPos, endPos int) {
b := h.bufKV.value[:0]
b = append(b, strBytes...)
@@ -887,9 +887,9 @@ func (h *RequestHeader) Len() int {
// while lowercasing all the other letters.
// Examples:
//
-// * CONNECTION -> Connection
-// * conteNT-tYPE -> Content-Type
-// * foo-bar-baz -> Foo-Bar-Baz
+// - CONNECTION -> Connection
+// - conteNT-tYPE -> Content-Type
+// - foo-bar-baz -> Foo-Bar-Baz
//
// Disable header names' normalization only if know what are you doing.
func (h *RequestHeader) DisableNormalizing() {
@@ -903,9 +903,9 @@ func (h *RequestHeader) DisableNormalizing() {
// the other letters.
// Examples:
//
-// * CONNECTION -> Connection
-// * conteNT-tYPE -> Content-Type
-// * foo-bar-baz -> Foo-Bar-Baz
+// - 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() {
@@ -919,9 +919,9 @@ func (h *RequestHeader) EnableNormalizing() {
// while lowercasing all the other letters.
// Examples:
//
-// * CONNECTION -> Connection
-// * conteNT-tYPE -> Content-Type
-// * foo-bar-baz -> Foo-Bar-Baz
+// - CONNECTION -> Connection
+// - conteNT-tYPE -> Content-Type
+// - foo-bar-baz -> Foo-Bar-Baz
//
// Disable header names' normalization only if know what are you doing.
func (h *ResponseHeader) DisableNormalizing() {
@@ -935,9 +935,9 @@ func (h *ResponseHeader) DisableNormalizing() {
// the other letters.
// Examples:
//
-// * CONNECTION -> Connection
-// * conteNT-tYPE -> Content-Type
-// * foo-bar-baz -> Foo-Bar-Baz
+// - 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() {
@@ -1516,13 +1516,13 @@ func (h *RequestHeader) SetCookieBytesKV(key, value []byte) {
// This doesn't work for a cookie with specific domain or path,
// you should delete it manually like:
//
-// c := AcquireCookie()
-// c.SetKey(key)
-// c.SetDomain("example.com")
-// c.SetPath("/path")
-// c.SetExpire(CookieExpireDelete)
-// h.SetCookie(c)
-// ReleaseCookie(c)
+// c := AcquireCookie()
+// c.SetKey(key)
+// c.SetDomain("example.com")
+// c.SetPath("/path")
+// c.SetExpire(CookieExpireDelete)
+// h.SetCookie(c)
+// ReleaseCookie(c)
//
// Use DelCookie if you want just removing the cookie from response header.
func (h *ResponseHeader) DelClientCookie(key string) {
@@ -1539,13 +1539,13 @@ func (h *ResponseHeader) DelClientCookie(key string) {
// This doesn't work for a cookie with specific domain or path,
// you should delete it manually like:
//
-// c := AcquireCookie()
-// c.SetKey(key)
-// c.SetDomain("example.com")
-// c.SetPath("/path")
-// c.SetExpire(CookieExpireDelete)
-// h.SetCookie(c)
-// ReleaseCookie(c)
+// c := AcquireCookie()
+// c.SetKey(key)
+// c.SetDomain("example.com")
+// c.SetPath("/path")
+// c.SetExpire(CookieExpireDelete)
+// h.SetCookie(c)
+// ReleaseCookie(c)
//
// Use DelCookieBytes if you want just removing the cookie from response header.
func (h *ResponseHeader) DelClientCookieBytes(key []byte) {
@@ -3176,9 +3176,9 @@ func removeNewLines(raw []byte) []byte {
// after dashes are also uppercased. All the other letters are lowercased.
// Examples:
//
-// * coNTENT-TYPe -> Content-Type
-// * HOST -> Host
-// * foo-bar-baz -> Foo-Bar-Baz
+// - coNTENT-TYPe -> Content-Type
+// - HOST -> Host
+// - foo-bar-baz -> Foo-Bar-Baz
func AppendNormalizedHeaderKey(dst []byte, key string) []byte {
dst = append(dst, key...)
normalizeHeaderKey(dst[len(dst)-len(key):], false)
@@ -3192,9 +3192,9 @@ func AppendNormalizedHeaderKey(dst []byte, key string) []byte {
// after dashes are also uppercased. All the other letters are lowercased.
// Examples:
//
-// * coNTENT-TYPe -> Content-Type
-// * HOST -> Host
-// * foo-bar-baz -> Foo-Bar-Baz
+// - coNTENT-TYPe -> Content-Type
+// - HOST -> Host
+// - foo-bar-baz -> Foo-Bar-Baz
func AppendNormalizedHeaderKeyBytes(dst, key []byte) []byte {
return AppendNormalizedHeaderKey(dst, b2s(key))
}