mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-16 21:56:40 -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
|
||||
if req != nil {
|
||||
_, err = io.Copy(writer, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// body length mismatch
|
||||
if lr, ok := req.(*io.LimitedReader); ok && lr.N > 0 {
|
||||
return nil, io.ErrUnexpectedEOF
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
err = writer.FlushStream()
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in a new issue