diff --git a/main.go b/main.go index c51664d..8c82df6 100644 --- a/main.go +++ b/main.go @@ -38,7 +38,7 @@ func init() { func main() { mux := http.NewServeMux() - mux.HandleFunc("/", handler.Handler) + mux.HandleFunc("POST /", handler.Handler) server := &http.Server{ Addr: fmt.Sprintf(":%d", port), diff --git a/pkg/handler/handler.go b/pkg/handler/handler.go index fa8b03a..9011a98 100644 --- a/pkg/handler/handler.go +++ b/pkg/handler/handler.go @@ -19,11 +19,6 @@ import ( ) func Handler(w http.ResponseWriter, req *http.Request) { - // only accept POST requests - if req.Method != http.MethodPost { - utils.SendResponse(nil, "only POST is allowed", w) - return - } // read request body requestBody, err := io.ReadAll(req.Body)