Skip to content

Commit

Permalink
test: fix typos in function, error message, comment (#1512)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandear authored Mar 6, 2023
1 parent 4ca6994 commit 498a814
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions header_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ func TestRequestHeaderDel(t *testing.T) {

cv := h.Cookie("foobar")
if len(cv) > 0 {
t.Fatalf("unexpected cookie obtianed: %q", cv)
t.Fatalf("unexpected cookie obtained: %q", cv)
}
if h.ContentLength() != 0 {
t.Fatalf("unexpected content-length: %d. Expecting 0", h.ContentLength())
Expand Down Expand Up @@ -673,7 +673,7 @@ func TestResponseHeaderDel(t *testing.T) {
}

if h.Cookie(&c) {
t.Fatalf("unexpected cookie obtianed: %q", &c)
t.Fatalf("unexpected cookie obtained: %q", &c)
}
if h.ContentLength() != 0 {
t.Fatalf("unexpected content-length: %d. Expecting 0", h.ContentLength())
Expand Down
2 changes: 1 addition & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -2225,7 +2225,7 @@ func (s *Server) serveConn(c net.Conn) (err error) {

// Reading Headers.
//
// If we have pipline response in the outgoing buffer,
// If we have pipeline response in the outgoing buffer,
// we only want to try and read the next headers once.
// If we have to wait for the next request we flush the
// outgoing buffer first so it doesn't have to wait.
Expand Down
8 changes: 4 additions & 4 deletions server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ func TestServerName(t *testing.T) {
},
}

getReponse := func() []byte {
getResponse := func() []byte {
rw := &readWriter{}
rw.r.WriteString("GET / HTTP/1.1\r\nHost: google.com\r\n\r\n")

Expand All @@ -400,7 +400,7 @@ func TestServerName(t *testing.T) {
return resp
}

resp := getReponse()
resp := getResponse()
if !bytes.Contains(resp, []byte("\r\nServer: "+defaultServerName+"\r\n")) {
t.Fatalf("Unexpected response %q expected Server: "+defaultServerName, resp)
}
Expand All @@ -412,7 +412,7 @@ func TestServerName(t *testing.T) {
Name: "foobar",
}

resp = getReponse()
resp = getResponse()
if !bytes.Contains(resp, []byte("\r\nServer: foobar\r\n")) {
t.Fatalf("Unexpected response %q expected Server: foobar", resp)
}
Expand All @@ -425,7 +425,7 @@ func TestServerName(t *testing.T) {
NoDefaultDate: true,
}

resp = getReponse()
resp = getResponse()
if bytes.Contains(resp, []byte("\r\nServer: ")) {
t.Fatalf("Unexpected response %q expected no Server header", resp)
}
Expand Down

0 comments on commit 498a814

Please sign in to comment.