diff options
author | knotteye <knotteye@airmail.cc> | 2021-05-30 21:58:16 -0500 |
---|---|---|
committer | knotteye <knotteye@airmail.cc> | 2021-05-30 22:20:16 -0500 |
commit | 45aaf27bcb676e245371bf46b710ab498cdcfcb5 (patch) | |
tree | 6ba6da3552eac1157c0e0ac9c2d11377e97bcca2 /main.go | |
parent | 30714d5e76a94947a49487f526e48a996f1d9eaa (diff) |
Better accept header parsing
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -33,7 +33,6 @@ var SiteEmailPassword = GetConfigValue("emailpass") var SiteEmailServer = GetConfigValue("emailserver") //mail.fchan.xyz var SiteEmailPort = GetConfigValue("emailport") //587 -var ldjson = "application/ld+json" var activitystreams = "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"" func main() { @@ -137,7 +136,7 @@ func main() { } if mainActor { - if accept == activitystreams || accept == ldjson { + if acceptActivity(accept) { GetActorInfo(w, db, Domain) return } @@ -180,7 +179,7 @@ func main() { } if actorMain || actorMainPage { - if accept == activitystreams || accept == ldjson { + if acceptActivity(accept) { GetActorInfo(w, db, actor.Id) return } @@ -267,7 +266,7 @@ func main() { //catch all if actorPost { - if accept == activitystreams || accept == ldjson { + if acceptActivity(accept) { GetActorPost(w, db, path) return } |