• Brad Fitzpatrick's avatar
    http: DoS protection: cap non-Handler Request.Body reads · 5079129d
    Brad Fitzpatrick authored
    Previously, if an http.Handler didn't fully consume a
    Request.Body before returning and the request and the response
    from the handler indicated no reason to close the connection,
    the server would read an unbounded amount of the request's
    unread body to advance past the request message to find the
    next request's header. That was a potential DoS.
    
    With this CL there's a threshold under which we read
    (currently 256KB) in order to keep the connection in
    keep-alive mode, but once we hit that, we instead
    switch into a "Connection: close" response and don't
    read the request body.
    
    Fixes #2093 (along with number of earlier CLs)
    
    R=golang-dev, dsymonds
    CC=golang-dev
    https://golang.org/cl/5268043
    5079129d
Name
Last commit
Last update
doc Loading commit data...
include Loading commit data...
lib Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.hgignore Loading commit data...
.hgtags Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...