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")
|
w.Header().Set("Content-Type", "application/json")
|
||||||
|
|
||||||
// Check request type and size
|
// 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)
|
http.Error(w, "{\"errmsg\":\"Requête invalide.\"}", http.StatusBadRequest)
|
||||||
return
|
return
|
||||||
} else if r.ContentLength < 0 || r.ContentLength > 2047 {
|
} else if r.ContentLength > 4097 {
|
||||||
http.Error(w, "{\"errmsg\":\"Requête trop longue ou de taille inconnue\"}", http.StatusRequestEntityTooLarge)
|
http.Error(w, "{\"errmsg\":\"Requête trop longue\"}", http.StatusRequestEntityTooLarge)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user