diff options
author | 2023-01-03 10:50:59 +0000 | |
---|---|---|
committer | 2023-01-03 11:50:59 +0100 | |
commit | 71dfea7e47eef3d89b0c4919d71a6ad58e35912d (patch) | |
tree | e2585e1b50865fff4d57f8270a4a388bcf61f8c7 /internal/api/client.go | |
parent | [docs] Add troubleshooting section for Apache (#1291) (diff) | |
download | gotosocial-71dfea7e47eef3d89b0c4919d71a6ad58e35912d.tar.xz |
[chore] shuffle middleware to split rate limitting into client/s2s/fileserver, share gzip middleware globally (#1290)
Signed-off-by: kim <grufwub@gmail.com>
Signed-off-by: kim <grufwub@gmail.com>
Diffstat (limited to 'internal/api/client.go')
-rw-r--r-- | internal/api/client.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/api/client.go b/internal/api/client.go index 7736a99f4..0874664a4 100644 --- a/internal/api/client.go +++ b/internal/api/client.go @@ -19,6 +19,7 @@ package api import ( + "github.com/gin-gonic/gin" "github.com/superseriousbusiness/gotosocial/internal/api/client/accounts" "github.com/superseriousbusiness/gotosocial/internal/api/client/admin" "github.com/superseriousbusiness/gotosocial/internal/api/client/apps" @@ -67,15 +68,14 @@ type Client struct { user *user.Module // api/v1/user } -func (c *Client) Route(r router.Router) { +func (c *Client) Route(r router.Router, m ...gin.HandlerFunc) { // create a new group on the top level client 'api' prefix apiGroup := r.AttachGroup("api") // attach non-global middlewares appropriate to the client api + apiGroup.Use(m...) apiGroup.Use( middleware.TokenCheck(c.db, c.processor.OAuthValidateBearerToken), - middleware.RateLimit(), - middleware.Gzip(), middleware.CacheControl("no-store"), // never cache api responses ) |