diff options
author | FChannel <> | 2022-04-30 11:00:55 -0700 |
---|---|---|
committer | FChannel <> | 2022-06-19 12:53:29 -0700 |
commit | 1892327cee2c3fa1d3bea729bd08eb63c2189a96 (patch) | |
tree | 7b846f7d9caf46fba6c9d15ff81b9d89dcca9476 /util/accept.go | |
parent | 5b52d269faa2ce2014d0feba603a2122361cf4eb (diff) |
restructured code base to prevent circular dependicies
Diffstat (limited to 'util/accept.go')
-rw-r--r-- | util/accept.go | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/util/accept.go b/util/accept.go deleted file mode 100644 index 2765c32..0000000 --- a/util/accept.go +++ /dev/null @@ -1,21 +0,0 @@ -package util - -import ( - "regexp" - "strings" -) - -// False positive for application/ld+ld, application/activity+ld, application/json+json -var activityRegexp = regexp.MustCompile("application\\/(ld|json|activity)((\\+(ld|json))|$)") - -func AcceptActivity(header string) bool { - accept := false - if strings.Contains(header, ";") { - split := strings.Split(header, ";") - accept = accept || activityRegexp.MatchString(split[0]) - accept = accept || strings.Contains(split[len(split)-1], "profile=\"https://www.w3.org/ns/activitystreams\"") - } else { - accept = accept || activityRegexp.MatchString(header) - } - return accept -} |