diff options
author | 2023-03-09 18:55:45 +0100 | |
---|---|---|
committer | 2023-03-09 17:55:45 +0000 | |
commit | a312238e7909c6451e608a91c326ad250dda875c (patch) | |
tree | 1395a27178a7ffd78486e3ddb00cd29dfce27cd8 /internal/api/wellknown.go | |
parent | [bug] Handle 410 on webfinger properly (#1601) (diff) | |
download | gotosocial-a312238e7909c6451e608a91c326ad250dda875c.tar.xz |
[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
Diffstat (limited to 'internal/api/wellknown.go')
-rw-r--r-- | internal/api/wellknown.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/internal/api/wellknown.go b/internal/api/wellknown.go index 7edbb4d7d..a837667fb 100644 --- a/internal/api/wellknown.go +++ b/internal/api/wellknown.go @@ -20,6 +20,7 @@ package api import ( "github.com/gin-gonic/gin" + "github.com/superseriousbusiness/gotosocial/internal/api/wellknown/hostmeta" "github.com/superseriousbusiness/gotosocial/internal/api/wellknown/nodeinfo" "github.com/superseriousbusiness/gotosocial/internal/api/wellknown/webfinger" "github.com/superseriousbusiness/gotosocial/internal/middleware" @@ -30,6 +31,7 @@ import ( type WellKnown struct { nodeInfo *nodeinfo.Module webfinger *webfinger.Module + hostMeta *hostmeta.Module } func (w *WellKnown) Route(r router.Router, m ...gin.HandlerFunc) { @@ -45,11 +47,13 @@ func (w *WellKnown) Route(r router.Router, m ...gin.HandlerFunc) { w.nodeInfo.Route(wellKnownGroup.Handle) w.webfinger.Route(wellKnownGroup.Handle) + w.hostMeta.Route(wellKnownGroup.Handle) } func NewWellKnown(p *processing.Processor) *WellKnown { return &WellKnown{ nodeInfo: nodeinfo.New(p), webfinger: webfinger.New(p), + hostMeta: hostmeta.New(p), } } |