IsEmpty returns true if the CORS configuration is empty - used instead of a nil check since we always initialize the CORS config struct.
()
| 34 | |
| 35 | // IsEmpty returns true if the CORS configuration is empty - used instead of a nil check since we always initialize the CORS config struct. |
| 36 | func (cors *CORSConfig) IsEmpty() bool { |
| 37 | return cors == nil || |
| 38 | (len(cors.Origin) == 0 && len(cors.LoginOrigin) == 0 && len(cors.Headers) == 0 && cors.MaxAge == 0) |
| 39 | } |
| 40 | |
| 41 | func MatchedOrigin(allowOrigins []string, rqOrigins []string) string { |
| 42 | for _, rv := range rqOrigins { |
no outgoing calls