access method via Method

This commit is contained in:
Aliaksandr Valialkin
2015-11-16 16:16:05 +02:00
parent 35bf5aa661
commit 9cddf93664
+2 -5
View File
@@ -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