Skip to content

Commit

Permalink
docs: update AllowOriginFunc comment (#6)
Browse files Browse the repository at this point in the history
* update AllowOriginFunc comment

* add priority description
  • Loading branch information
Skyenought authored Nov 6, 2023
1 parent 2bc83a8 commit 9c26ea9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ type Config struct {
// Default value is []
AllowOrigins []string

// AllowOriginFunc is a custom function to validate the origin. It take the origin
// as argument and returns true if allowed or false otherwise. If this option is
// set, the content of AllowOrigins is ignored.
// AllowOriginFunc is a custom function to validate the origin. It takes the origin
// as argument and returns true if allowed or false otherwise.
// AllowOrigins have a higher AllowOrigins have a higher priority than AllowOriginFunc
// It is recommended to use AllowOriginFunc without setting AllowOrigins.
AllowOriginFunc func(origin string) bool

// AllowMethods is a list of methods the client is allowed to use with
Expand Down

0 comments on commit 9c26ea9

Please sign in to comment.