mirror of
https://github.com/valyala/fasthttp.git
synced 2026-06-26 17:46:34 +03:00
access method via Method
This commit is contained in:
@@ -773,10 +773,7 @@ func (h *ResponseHeader) Write(w *bufio.Writer) error {
|
||||
|
||||
// Write writes request header to w.
|
||||
func (h *RequestHeader) Write(w *bufio.Writer) error {
|
||||
method := h.method
|
||||
if len(method) == 0 {
|
||||
method = strGet
|
||||
}
|
||||
method := h.Method()
|
||||
w.Write(method)
|
||||
w.WriteByte(' ')
|
||||
|
||||
@@ -908,7 +905,7 @@ func (h *RequestHeader) parseFirstLine(buf []byte) (b []byte, err error) {
|
||||
if n <= 0 {
|
||||
return nil, fmt.Errorf("cannot find http request method in %q", buf)
|
||||
}
|
||||
h.method = append(h.method[:0], b[:n]...)
|
||||
h.SetMethodBytes(b[:n])
|
||||
b = b[n+1:]
|
||||
|
||||
// parse requestURI
|
||||
|
||||
Reference in New Issue
Block a user