File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -14,15 +14,15 @@ type cors struct {
1414 allowedHeaders []string
1515 allowedMethods []string
1616 allowedOrigins []string
17- allowedOriginValidator originValidator
17+ allowedOriginValidator OriginValidator
1818 exposedHeaders []string
1919 maxAge int
2020 ignoreOptions bool
2121 allowCredentials bool
2222}
2323
24- // originValidator takes an origin string and returns whether or not that origin is allowed.
25- type originValidator func(string) bool
24+ // OriginValidator takes an origin string and returns whether or not that origin is allowed.
25+ type OriginValidator func(string) bool
2626
2727var (
2828 defaultCorsMethods = []string{"GET", "HEAD", "POST"}
@@ -223,7 +223,7 @@ func AllowedOrigins(origins []string) CORSOption {
223223
224224// AllowedOriginValidator sets a function for evaluating allowed origins in CORS requests, represented by the
225225// 'Allow-Access-Control-Origin' HTTP header.
226- func AllowedOriginValidator(fn originValidator ) CORSOption {
226+ func AllowedOriginValidator(fn OriginValidator ) CORSOption {
227227 return func(ch *cors) error {
228228 ch.allowedOriginValidator = fn
229229 return nil
You can’t perform that action at this time.
0 commit comments