mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2025-10-29 05:05:42 +00:00
fix: fix docker label matching logic
This commit is contained in:
@@ -293,14 +293,14 @@ func ParseSecretFile(contents string) string {
|
||||
}
|
||||
|
||||
// Check if a string matches a regex or if it is included in a comma separated list
|
||||
func CheckFilter(filter string, str string, regex bool) bool {
|
||||
func CheckFilter(filter string, str string) bool {
|
||||
// Check if the filter is empty
|
||||
if len(strings.TrimSpace(filter)) == 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
// Check if the filter is a regex
|
||||
if strings.HasPrefix(filter, "/") && strings.HasSuffix(filter, "/") && regex {
|
||||
if strings.HasPrefix(filter, "/") && strings.HasSuffix(filter, "/") {
|
||||
// Create regex
|
||||
re, err := regexp.Compile(filter[1 : len(filter)-1])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user