Bumps [github.com/libregraph/lico](https://github.com/libregraph/lico) from 0.62.0 to 0.64.0. - [Changelog](https://github.com/libregraph/lico/blob/master/CHANGELOG.md) - [Commits](https://github.com/libregraph/lico/compare/v0.62.0...v0.64.0) --- updated-dependencies: - dependency-name: github.com/libregraph/lico dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
26 lines
474 B
Go
26 lines
474 B
Go
package cors
|
|
|
|
import (
|
|
"strings"
|
|
)
|
|
|
|
type wildcard struct {
|
|
prefix string
|
|
suffix string
|
|
}
|
|
|
|
func (w wildcard) match(s string) bool {
|
|
return len(s) >= len(w.prefix)+len(w.suffix) &&
|
|
strings.HasPrefix(s, w.prefix) &&
|
|
strings.HasSuffix(s, w.suffix)
|
|
}
|
|
|
|
// convert converts a list of string using the passed converter function
|
|
func convert(s []string, f func(string) string) []string {
|
|
out := make([]string, len(s))
|
|
for i := range s {
|
|
out[i] = f(s[i])
|
|
}
|
|
return out
|
|
}
|