package http import ( "net/http" ) func postValidCheckWithResponseOnFail(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 }