Skip to content

Commit

Permalink
valyala#660 Incorrect content length
Browse files Browse the repository at this point in the history
  • Loading branch information
kevburnsjr committed Oct 26, 2019
1 parent 9bc6da1 commit 7eeee50
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2519,6 +2519,22 @@ func TestServerConnectionClose(t *testing.T) {
}
}

func TestIncorrectContentLength(t *testing.T) {
rw := &readWriter{}
rw.r.WriteString("POST /foo HTTP/1.1\r\nHost: google.com\r\nContent-Length: 5\r\nContent-Type: aaa\r\n\r\n123")
s := &Server{Handler: func(ctx *RequestCtx) {}}
ch := make(chan error)
go func() {
ch <- s.ServeConn(rw)
}()
select {
case err := <-ch:
if err != nil {
t.Fatal(err)
}
}
}

func TestServerRequestNumAndTime(t *testing.T) {
t.Parallel()

Expand Down

0 comments on commit 7eeee50

Please sign in to comment.