aboutsummaryrefslogtreecommitdiff
path: root/util.go
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-02-02 13:32:12 +0100
committerAlex Auvolat <alex@adnab.me>2020-02-02 13:32:12 +0100
commit4c037dcb94d2c663da9e624ba44dac0f833bc804 (patch)
tree4a110c2ccb999f0b343da98402273c67fe8cdc1f /util.go
parente9e7a4cb4bdf0a1fe0356d465f8becac49b46320 (diff)
downloadbottin-4c037dcb94d2c663da9e624ba44dac0f833bc804.tar.gz
bottin-4c037dcb94d2c663da9e624ba44dac0f833bc804.zip
Bug fix: case-insensitive value match (except for passwords)
Diffstat (limited to 'util.go')
-rw-r--r--util.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/util.go b/util.go
index d778bc2..4add5ee 100644
--- a/util.go
+++ b/util.go
@@ -138,3 +138,11 @@ func genUuid() string {
}
return uuid.String()
}
+
+func valueMatch(attr, val1, val2 string) bool {
+ if strings.EqualFold(attr, ATTR_USERPASSWORD) {
+ return val1 == val2
+ } else {
+ return strings.EqualFold(val1, val2)
+ }
+}