Skip to content

Commit

Permalink
Merge pull request #200 from bavix/3.x
Browse files Browse the repository at this point in the history
[3.x] handlers.CORS
  • Loading branch information
rez1dent3 authored Mar 18, 2024
2 parents e117e4d + ed5b4c1 commit 3e4bd0a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ module github.com/bavix/gripmock
go 1.22.0

require (
github.com/bavix/gripmock-sdk-go v1.0.1
github.com/bavix/gripmock-sdk-go v1.0.2
github.com/bavix/gripmock/protogen v0.0.0
github.com/goccy/go-yaml v1.11.3
github.com/google/uuid v1.6.0
github.com/gorilla/handlers v1.5.2
github.com/gorilla/mux v1.8.1
github.com/hashicorp/go-memdb v1.3.4
github.com/joho/godotenv v1.5.1
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk=
github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ=
github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP2+08jFMw88y4klk=
github.com/bavix/gripmock-sdk-go v1.0.1 h1:JWl0Op7vbzcmwI2y7hKSO0BRXjeikh2tPhqs+e17ifY=
github.com/bavix/gripmock-sdk-go v1.0.1/go.mod h1:xAznUTec/TEFKw7dOki0/HwgbIuWOv0uRD1vaGRK3iE=
github.com/bavix/gripmock-sdk-go v1.0.2 h1:9FM8G4VVvwNrqGlbAvHjwM8h/TnbrCo4nJhsC8Lvaxw=
github.com/bavix/gripmock-sdk-go v1.0.2/go.mod h1:/Z/81NJ7un4AIeAClLMJhZDyY9CBQOsSbPDqYds2kEY=
github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w=
github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
Expand Down Expand Up @@ -36,6 +36,8 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/handlers v1.5.2 h1:cLTUSsNkgcwhgRqvCNmdbRWG0A3N4F+M2nWKdScwyEE=
github.com/gorilla/handlers v1.5.2/go.mod h1:dX+xVpaxdSw+q0Qek8SSsl3dfMk3jNddUkMzo0GtH0w=
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 h1:/c3QmbOGMGTOumP2iT/rCwB7b0QDGLKzqOmktBjT+Is=
Expand Down
3 changes: 2 additions & 1 deletion stub/stub.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"net/http"
"time"

"github.com/gorilla/handlers"
"github.com/gorilla/mux"
"github.com/rs/zerolog"

Expand Down Expand Up @@ -40,7 +41,7 @@ func RunRestServer(ctx context.Context, ch chan struct{}, opt Options) {
BaseContext: func(listener net.Listener) context.Context {
return ctx
},
Handler: router,
Handler: handlers.CORS()(router),
}

zerolog.Ctx(ctx).
Expand Down

0 comments on commit 3e4bd0a

Please sign in to comment.