Skip to content

A self-hosted dashboard that puts all your feeds in one place

Limit request body size in authentication handler to 512KB

Svilen Markove565fd7f2ea8
diff --git a/internal/glance/auth.go b/internal/glance/auth.go
index e6497a1..bd1d006 100644
--- a/internal/glance/auth.go
+++ b/internal/glance/auth.go
@@ -178,7 +178,7 @@ func (a *application) handleAuthenticationAttempt(w http.ResponseWriter, r *http
a.authAttemptsMu.Unlock()
}
- body, err := io.ReadAll(r.Body)
+ body, err := io.ReadAll(http.MaxBytesReader(w, r.Body, 512*1024))
if err != nil {
w.WriteHeader(http.StatusBadRequest)
return