added http.reader maximum buffer check
This commit is contained in:
parent
7db4d2ee1f
commit
c4863e396b
|
@ -6,6 +6,7 @@ package reader
|
||||||
// the golang standard library
|
// the golang standard library
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"bufio"
|
"bufio"
|
||||||
)
|
)
|
||||||
|
@ -55,6 +56,10 @@ func (r *chunkReader) Read() ([]byte, error){
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(line) > maxLineLength {
|
||||||
|
return nil, fmt.Errorf("HTTP line %d exceeded buffer size %d", len(line), maxLineLength)
|
||||||
|
}
|
||||||
|
|
||||||
/* (4) Trim */
|
/* (4) Trim */
|
||||||
line = removeTrailingSpace(line)
|
line = removeTrailingSpace(line)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue