[feature] Provide .well-known/host-meta endpoint (#1604)

* [feature] Provide .well-known/host-meta endpoint

This adds the host-meta endpoint as Mastodon clients use this to
discover the API domain to use when the host and account domains aren't
the same.

* Address review comments
This commit is contained in:
Daenney 2023-03-09 18:55:45 +01:00 committed by GitHub
commit a312238e79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 167 additions and 4 deletions

View file

@ -58,6 +58,11 @@ var HTMLOrActivityPubHeaders = []MIME{
AppActivityLDJSON,
}
var HostMetaHeaders = []MIME{
AppXMLXRD,
AppXML,
}
// NegotiateAccept takes the *gin.Context from an incoming request, and a
// slice of Offers, and performs content negotiation for the given request
// with the given content-type offers. It will return a string representation