Skip to content

Commit

Permalink
node: support http PUT or POST for new ccq queries
Browse files Browse the repository at this point in the history
  • Loading branch information
SEJeff committed Oct 11, 2023
1 parent a8f487c commit ec08acb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions node/cmd/ccq/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit ec08acb

Please sign in to comment.