Skip to content

Commit fcf8885

Browse files
committed
Rename maxRequestSize setting, default to unset
1 parent bcce705 commit fcf8885

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

server.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ var (
2222
// This method handles all requests. It dispatches to handleInternal after
2323
// handling / adapting websocket connections.
2424
func handle(w http.ResponseWriter, r *http.Request) {
25-
r.Body = http.MaxBytesReader(w, r.Body, int64(Config.IntDefault("http.maxRequestSize", 10000000)))
25+
if maxRequestSize := int64(Config.IntDefault("http.maxrequestsize", 0)); maxRequestSize > 0 {
26+
r.Body = http.MaxBytesReader(w, r.Body, maxRequestSize)
27+
}
28+
2629
upgrade := r.Header.Get("Upgrade")
2730
if upgrade == "websocket" || upgrade == "Websocket" {
2831
websocket.Handler(func(ws *websocket.Conn) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy