Compare commits

..

1 Commits

Author SHA1 Message Date
bagas 34000962ef fix(httphandler): use readSlice for reading http header
Docker Build and Push / Run Tests (push) Successful in 2m30s
Docker Build and Push / Build and Push Docker Image (push) Successful in 14m44s
Tests / Run Tests (pull_request) Successful in 2m27s
2026-07-18 15:29:01 +07:00
+7 -1
View File
@@ -56,8 +56,14 @@ func (hh *httpHandler) badRequest(conn net.Conn) error {
func readHTTPHeader(br *bufio.Reader, limit int) ([]byte, error) {
var headerBuf []byte
for {
line, err := br.ReadBytes('\n')
line, err := br.ReadSlice('\n')
headerBuf = append(headerBuf, line...)
if errors.Is(err, bufio.ErrBufferFull) {
if len(headerBuf) > limit {
return nil, fmt.Errorf("headers too large")
}
continue
}
if err != nil {
return nil, err
}