idk
This commit is contained in:
@@ -4,10 +4,14 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func methodAllowed(response *http.ResponseWriter, request *http.Request) bool {
|
||||
func requestValidCheck(response *http.ResponseWriter, request *http.Request) bool {
|
||||
if request.Method != http.MethodPost {
|
||||
http.Error(*response, "POST only", http.StatusMethodNotAllowed)
|
||||
return false
|
||||
}
|
||||
if request.ContentLength > 8192 {
|
||||
http.Error(*response, "Request too large", http.StatusRequestEntityTooLarge)
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user