From d6b28808aed237361642fe05fa2c98478b2003f4 Mon Sep 17 00:00:00 2001 From: linhpn99 Date: Sun, 28 Jul 2024 10:58:14 +0700 Subject: [PATCH] first --- cmd/start.go | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/cmd/start.go b/cmd/start.go index a9836f41..16605b1f 100644 --- a/cmd/start.go +++ b/cmd/start.go @@ -11,7 +11,6 @@ import ( "github.com/go-chi/chi/v5" "github.com/go-chi/httprate" "github.com/peterbourgon/ff/v3/ffcli" - "github.com/rs/cors" "go.uber.org/zap" "github.com/gnolang/tx-indexer/client" @@ -169,17 +168,6 @@ func (c *startCfg) exec(ctx context.Context) error { mux := chi.NewMux() - // Tạo middleware CORS - corsMiddleware := cors.New(cors.Options{ - AllowedOrigins: []string{"*"}, - AllowedMethods: []string{"GET", "POST", "OPTIONS"}, - AllowedHeaders: []string{"Content-Type", "Authorization"}, - AllowCredentials: true, - }) - - // Áp dụng middleware CORS - mux.Use(corsMiddleware.Handler) - if c.rateLimit != 0 { logger.Info("rate-limit set", zap.Int("rate-limit", c.rateLimit)) mux.Use(httprate.Limit(