SlyMarbo / spdy

[deprecated] A full-featured SPDY library for the Go language.
BSD 2-Clause "Simplified" License
116 stars 13 forks source link

POST/PUT requests' data is being refused. #22

Closed SlyMarbo closed 11 years ago

SlyMarbo commented 11 years ago

When POST/PUT requests send the request data, it is currently being refused, since the server is not configured to receive data. Working on it.

cpg commented 11 years ago

I tried a simple POST from a client and the data is received, however, there is an error printed on the standard output (even without debug enabled, tho):

(spdy) 2013/09/11 03:03:39 spdy3_conn.go:368: Error: Received DATA with Stream ID 1, which should be even.

this can be reproduced with

res, err := client.PostForm("https://example.com/", url.Values{"key": {"value"}, "id": {"123"}})

with debug enabled, i see that the headers of the POST made it without complaint. it's when the body arrived that the error was printed:

...
(spdy debug) 2013/09/11 03:24:47 Initial window size is 10485760.
(spdy debug) 2013/09/11 03:24:47 Received Frame:
(spdy debug) 2013/09/11 03:24:47 DATA {
    Stream ID:            1
    Flags:                FLAG_FIN
    Length:               16
    Data:                 [105 100 61 49 50 51 38 107 101 121 61 118 97 108 117 101]
}

(spdy) 2013/09/11 03:24:47 spdy3_conn.go:368: Error: Received DATA with Stream ID 1, which should be even.

the contents of the data above is the body of the post:

id=123&key=value

One other thing I notice is that subsequent

cpg commented 11 years ago

Update: this error is not printing when the request method is a PUT