Limit the query body size
This commit is contained in:
parent
5d6f9358c9
commit
aad9c8f19c
|
@ -2,6 +2,7 @@ package main
|
|||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net"
|
||||
"net/http"
|
||||
|
@ -31,7 +32,7 @@ func (handler localDoHHandler) ServeHTTP(writer http.ResponseWriter, request *ht
|
|||
return
|
||||
}
|
||||
xClientAddr := net.Addr(clientAddr)
|
||||
packet, err := ioutil.ReadAll(request.Body)
|
||||
packet, err := ioutil.ReadAll(io.LimitReader(request.Body, MaxHTTPBodyLength))
|
||||
if err != nil {
|
||||
dlog.Warnf("No body in a local DoH query")
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue