From 9c26ea9cf9f1a9eafed237194d00cee56dd268c2 Mon Sep 17 00:00:00 2001 From: Jiun Lee Date: Mon, 6 Nov 2023 14:25:20 +0800 Subject: [PATCH] docs: update AllowOriginFunc comment (#6) * update AllowOriginFunc comment * add priority description --- config.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/config.go b/config.go index f14860d..bb42020 100644 --- a/config.go +++ b/config.go @@ -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