func AssertHttpMethod()

in helpers/helpers.go [40:48]


func AssertHttpMethod(request *http.Request, w http.ResponseWriter, method string) bool {
	if request.Method != method {
		log.Printf("Got a %s request, expecting %s", request.Method, method)
		WriteJsonContent(GenericErrorResponse{"error", "wrong method type"}, w, 405)
		return false
	} else {
		return true
	}
}