Skip to content

net/http: wrong errors from ReadRequest #3298

@gopherbot

Description

@gopherbot

by peterthrun@ymail.com:

What steps will reproduce the problem?
1. http://play.golang.org/p/eYUX4vZzNB 

What is the expected output?

"GET / HTTP/1.1\r\nheader:foo\r\n\r\n" <nil>
"GET / HTTP/1.1\r\nheader:foo\r\n" unexpected EOF
"" EOF

What do you see instead?

"GET / HTTP/1.1\r\nheader:foo\r\n\r\n" <nil>
"GET / HTTP/1.1\r\nheader:foo\r\n" EOF
"" unexpected EOF

Please provide any additional information below.

I expect ReadRequest to return io.ErrUnexpectedEOF when the stream ends in the middle of
a request and io.EOF when the stream ends at a request boundary.  The opposite errors
are returned.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions