aboutsummaryrefslogtreecommitdiff
path: root/http.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 /http.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 'http.go')
-rw-r--r--http.go62
1 files changed, 31 insertions, 31 deletions
diff --git a/http.go b/http.go
index cfeeac5..97bf5d6 100644
--- a/http.go
+++ b/http.go
@@ -255,9 +255,9 @@ func (resp *Response) IsBodyStream() bool {
//
// This function may be used in the following cases:
//
-// * if request body is too big (more than 10MB).
-// * if request body is streamed from slow external sources.
-// * if request body must be streamed to the server in chunks
+// - if request body is too big (more than 10MB).
+// - if request body is streamed from slow external sources.
+// - if request body must be streamed to the server in chunks
// (aka `http client push` or `chunked transfer-encoding`).
//
// Note that GET and HEAD requests cannot have body.
@@ -272,9 +272,9 @@ func (req *Request) SetBodyStreamWriter(sw StreamWriter) {
//
// This function may be used in the following cases:
//
-// * if response body is too big (more than 10MB).
-// * if response body is streamed from slow external sources.
-// * if response body must be streamed to the client in chunks
+// - if response body is too big (more than 10MB).
+// - if response body is streamed from slow external sources.
+// - if response body must be streamed to the client in chunks
// (aka `http server push` or `chunked transfer-encoding`).
//
// See also SetBodyStream.
@@ -1081,11 +1081,11 @@ func (resp *Response) resetSkipHeader() {
//
// If MayContinue returns true, the caller must:
//
-// - Either send StatusExpectationFailed response if request headers don't
-// satisfy the caller.
-// - Or send StatusContinue response before reading request body
-// with ContinueReadBody.
-// - Or close the connection.
+// - Either send StatusExpectationFailed response if request headers don't
+// satisfy the caller.
+// - Or send StatusContinue response before reading request body
+// with ContinueReadBody.
+// - Or close the connection.
//
// io.EOF is returned if r is closed before reading the first header byte.
func (req *Request) Read(r *bufio.Reader) error {
@@ -1109,11 +1109,11 @@ var ErrGetOnly = errors.New("non-GET request received")
//
// If MayContinue returns true, the caller must:
//
-// - Either send StatusExpectationFailed response if request headers don't
-// satisfy the caller.
-// - Or send StatusContinue response before reading request body
-// with ContinueReadBody.
-// - Or close the connection.
+// - Either send StatusExpectationFailed response if request headers don't
+// satisfy the caller.
+// - Or send StatusContinue response before reading request body
+// with ContinueReadBody.
+// - Or close the connection.
//
// io.EOF is returned if r is closed before reading the first header byte.
func (req *Request) ReadLimitBody(r *bufio.Reader, maxBodySize int) error {
@@ -1166,11 +1166,11 @@ func (req *Request) readBodyStream(r *bufio.Reader, maxBodySize int, getOnly boo
//
// The caller must do one of the following actions if MayContinue returns true:
//
-// - Either send StatusExpectationFailed response if request headers don't
-// satisfy the caller.
-// - Or send StatusContinue response before reading request body
-// with ContinueReadBody.
-// - Or close the connection.
+// - Either send StatusExpectationFailed response if request headers don't
+// satisfy the caller.
+// - Or send StatusContinue response before reading request body
+// with ContinueReadBody.
+// - Or close the connection.
func (req *Request) MayContinue() bool {
return bytes.Equal(req.Header.peek(strExpect), str100Continue)
}
@@ -1562,11 +1562,11 @@ func (resp *Response) WriteGzip(w *bufio.Writer) error {
//
// Level is the desired compression level:
//
-// * CompressNoCompression
-// * CompressBestSpeed
-// * CompressBestCompression
-// * CompressDefaultCompression
-// * CompressHuffmanOnly
+// - CompressNoCompression
+// - CompressBestSpeed
+// - CompressBestCompression
+// - CompressDefaultCompression
+// - CompressHuffmanOnly
//
// The method gzips response body and sets 'Content-Encoding: gzip'
// header before writing response to w.
@@ -1593,11 +1593,11 @@ func (resp *Response) WriteDeflate(w *bufio.Writer) error {
//
// Level is the desired compression level:
//
-// * CompressNoCompression
-// * CompressBestSpeed
-// * CompressBestCompression
-// * CompressDefaultCompression
-// * CompressHuffmanOnly
+// - CompressNoCompression
+// - CompressBestSpeed
+// - CompressBestCompression
+// - CompressDefaultCompression
+// - CompressHuffmanOnly
//
// The method deflates response body and sets 'Content-Encoding: deflate'
// header before writing response to w.