diff options
author | 2023-11-27 15:02:52 +0100 | |
---|---|---|
committer | 2023-11-27 14:02:52 +0000 | |
commit | 5eddef6c9b66fd35dc9473578d4e1a3b1b8d7b08 (patch) | |
tree | ee67f8a683a351580bc0b6365067001c34ff1cc1 /internal/api/client/admin/admin.go | |
parent | [performance] http response encoding / writing improvements (#2374) (diff) | |
download | gotosocial-5eddef6c9b66fd35dc9473578d4e1a3b1b8d7b08.tar.xz |
[feature] Add `/api/v1/admin/debug/apurl` endpoint (#2359)
Diffstat (limited to 'internal/api/client/admin/admin.go')
-rw-r--r-- | internal/api/client/admin/admin.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/internal/api/client/admin/admin.go b/internal/api/client/admin/admin.go index 3d8e88c42..16c5fa8f8 100644 --- a/internal/api/client/admin/admin.go +++ b/internal/api/client/admin/admin.go @@ -20,6 +20,7 @@ package admin import ( "net/http" + "codeberg.org/gruf/go-debug" "github.com/gin-gonic/gin" "github.com/superseriousbusiness/gotosocial/internal/processing" ) @@ -46,6 +47,8 @@ const ( EmailTestPath = EmailPath + "/test" InstanceRulesPath = BasePath + "/instance/rules" InstanceRulesPathWithID = InstanceRulesPath + "/:" + IDKey + DebugPath = BasePath + "/debug" + DebugAPUrlPath = DebugPath + "/apurl" IDKey = "id" FilterQueryKey = "filter" @@ -116,4 +119,9 @@ func (m *Module) Route(attachHandler func(method string, path string, f ...gin.H attachHandler(http.MethodPost, InstanceRulesPath, m.RulePOSTHandler) attachHandler(http.MethodPatch, InstanceRulesPathWithID, m.RulePATCHHandler) attachHandler(http.MethodDelete, InstanceRulesPathWithID, m.RuleDELETEHandler) + + // debug stuff + if debug.DEBUG { + attachHandler(http.MethodGet, DebugAPUrlPath, m.DebugAPUrlHandler) + } } |