Make activitypub types comparisons be case insensitive

This commit is contained in:
Marius Orcsik 2020-03-26 11:38:02 +01:00
parent 333ff2b6c2
commit 0a2f998222
No known key found for this signature in database
GPG key ID: 77618B618F79EB72

View file

@ -2,6 +2,7 @@ package activitypub
import (
"errors"
"strings"
"time"
"unsafe"
)
@ -42,7 +43,7 @@ type ActivityVocabularyTypes []ActivityVocabularyType
func (a ActivityVocabularyTypes) Contains(typ ActivityVocabularyType) bool {
for _, v := range a {
if v == typ {
if strings.ToLower(string(v)) == strings.ToLower(string(typ)) {
return true
}
}