From b5d8ffed6484e1eeecce9ff1747168397dc3f7dc Mon Sep 17 00:00:00 2001 From: Jeff Schroeder Date: Wed, 11 Oct 2023 16:47:40 +0000 Subject: [PATCH] node: support http PUT or POST for new ccq queries --- node/cmd/ccq/http.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/node/cmd/ccq/http.go b/node/cmd/ccq/http.go index f6527221f8..d3387add77 100644 --- a/node/cmd/ccq/http.go +++ b/node/cmd/ccq/http.go @@ -44,7 +44,7 @@ func (s *httpServer) handleQuery(w http.ResponseWriter, r *http.Request) { // Set CORS headers for the preflight request if r.Method == http.MethodOptions { - w.Header().Set("Access-Control-Allow-Methods", "PUT") + w.Header().Set("Access-Control-Allow-Methods", "PUT, POST") w.Header().Set("Access-Control-Allow-Headers", "Content-Type, X-Api-Key") w.Header().Set("Access-Control-Max-Age", "3600") w.WriteHeader(http.StatusNoContent) @@ -169,7 +169,7 @@ func NewHTTPServer(addr string, t *pubsub.Topic, permissions Permissions, signer env: env, } r := mux.NewRouter() - r.HandleFunc("/v1/query", s.handleQuery).Methods("PUT", "OPTIONS") + r.HandleFunc("/v1/query", s.handleQuery).Methods("PUT", "POST", "OPTIONS") r.HandleFunc("/v1/health", s.handleHealth).Methods("GET") return &http.Server{ Addr: addr,