diff options
author | 2023-11-27 14:00:57 +0000 | |
---|---|---|
committer | 2023-11-27 14:00:57 +0000 | |
commit | 74700cc8034980334e7df466f313287a41d2b8a6 (patch) | |
tree | 63ab8912c813eefba8a492e0d0489f4e5fe59446 /internal/api/wellknown/nodeinfo/nodeinfoget.go | |
parent | [chore]: Bump codeberg.org/gruf/go-mutexes from 1.3.0 to 1.3.1 (#2387) (diff) | |
download | gotosocial-74700cc8034980334e7df466f313287a41d2b8a6.tar.xz |
[performance] http response encoding / writing improvements (#2374)
Diffstat (limited to 'internal/api/wellknown/nodeinfo/nodeinfoget.go')
-rw-r--r-- | internal/api/wellknown/nodeinfo/nodeinfoget.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/internal/api/wellknown/nodeinfo/nodeinfoget.go b/internal/api/wellknown/nodeinfo/nodeinfoget.go index 3cbb29650..c458f131e 100644 --- a/internal/api/wellknown/nodeinfo/nodeinfoget.go +++ b/internal/api/wellknown/nodeinfo/nodeinfoget.go @@ -55,5 +55,12 @@ func (m *Module) NodeInfoWellKnownGETHandler(c *gin.Context) { return } - c.JSON(http.StatusOK, resp) + // Encode JSON HTTP response. + apiutil.EncodeJSONResponse( + c.Writer, + c.Request, + http.StatusOK, + apiutil.AppJSON, + resp, + ) } |