frontend: Increase input size allowed
This commit is contained in:
parent
c7569b5e54
commit
7896579189
@ -37,11 +37,11 @@ func (c submissionChecker) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
|
||||
// Check request type and size
|
||||
if r.Method != "POST" {
|
||||
if r.Method != "POST" || r.ContentLength < 0 {
|
||||
http.Error(w, "{\"errmsg\":\"Requête invalide.\"}", http.StatusBadRequest)
|
||||
return
|
||||
} else if r.ContentLength < 0 || r.ContentLength > 2047 {
|
||||
http.Error(w, "{\"errmsg\":\"Requête trop longue ou de taille inconnue\"}", http.StatusRequestEntityTooLarge)
|
||||
} else if r.ContentLength > 4097 {
|
||||
http.Error(w, "{\"errmsg\":\"Requête trop longue\"}", http.StatusRequestEntityTooLarge)
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user