mirror of
https://github.com/usememos/memos.git
synced 2025-03-25 23:20:12 +01:00
chore: add cors middleware
This commit is contained in:
parent
ad326147f1
commit
6d45616dbe
@ -66,6 +66,12 @@ func NewServer(ctx context.Context, profile *profile.Profile, store *store.Store
|
||||
|
||||
e.Use(middleware.Gzip())
|
||||
|
||||
e.Use(middleware.CORSWithConfig(middleware.CORSConfig{
|
||||
Skipper: grpcRequestSkipper,
|
||||
AllowOrigins: []string{"*"},
|
||||
AllowMethods: []string{http.MethodGet, http.MethodHead, http.MethodPut, http.MethodPatch, http.MethodPost, http.MethodDelete},
|
||||
}))
|
||||
|
||||
e.Use(middleware.TimeoutWithConfig(middleware.TimeoutConfig{
|
||||
Skipper: grpcRequestSkipper,
|
||||
Timeout: 30 * time.Second,
|
||||
|
Loading…
x
Reference in New Issue
Block a user