mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-30 22:34:15 -05:00
check if body is less than anticipated when there is no error reported
This commit is contained in:
parent
7d483ff3ef
commit
8c803b503c
1 changed files with 3 additions and 3 deletions
|
@ -157,13 +157,13 @@ func (c *client) Do(p map[string]string, req io.Reader) (r io.Reader, err error)
|
||||||
writer.recType = Stdin
|
writer.recType = Stdin
|
||||||
if req != nil {
|
if req != nil {
|
||||||
_, err = io.Copy(writer, req)
|
_, err = io.Copy(writer, req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
// body length mismatch
|
// body length mismatch
|
||||||
if lr, ok := req.(*io.LimitedReader); ok && lr.N > 0 {
|
if lr, ok := req.(*io.LimitedReader); ok && lr.N > 0 {
|
||||||
return nil, io.ErrUnexpectedEOF
|
return nil, io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
err = writer.FlushStream()
|
err = writer.FlushStream()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue