diff options
author | 2022-05-02 12:53:46 +0200 | |
---|---|---|
committer | 2022-05-02 11:53:46 +0100 | |
commit | a5852fd7e43bf97ea7def9de20cd6d02d954094d (patch) | |
tree | d72b7fe9bf603786a5533e6b566a8412b2b8f634 /internal/api | |
parent | Add logging to the new generic worker package (#516) (diff) | |
download | gotosocial-a5852fd7e43bf97ea7def9de20cd6d02d954094d.tar.xz |
[performance] Speed up some of the slower db queries (#523)
* remove unnecessary LOWER() db calls
* warn during slow db queries
* use bundb built-in exists function
* add db block test
* update account block query
* add domain block db test
* optimize domain block query
* fix implementing wrong test
* exclude most columns when checking block
* go fmt
* remote more unnecessary use of LOWER()
Diffstat (limited to 'internal/api')
-rw-r--r-- | internal/api/s2s/user/statusget.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/internal/api/s2s/user/statusget.go b/internal/api/s2s/user/statusget.go index d16026d40..3dee0c88a 100644 --- a/internal/api/s2s/user/statusget.go +++ b/internal/api/s2s/user/statusget.go @@ -22,6 +22,7 @@ import ( "encoding/json" "fmt" "net/http" + "strings" "github.com/gin-gonic/gin" "github.com/sirupsen/logrus" @@ -35,13 +36,15 @@ func (m *Module) StatusGETHandler(c *gin.Context) { "url": c.Request.RequestURI, }) - requestedUsername := c.Param(UsernameKey) + // usernames on our instance are always lowercase + requestedUsername := strings.ToLower(c.Param(UsernameKey)) if requestedUsername == "" { c.JSON(http.StatusBadRequest, gin.H{"error": "no username specified in request"}) return } - requestedStatusID := c.Param(StatusIDKey) + // status IDs on our instance are always uppercase + requestedStatusID := strings.ToUpper(c.Param(StatusIDKey)) if requestedStatusID == "" { c.JSON(http.StatusBadRequest, gin.H{"error": "no status id specified in request"}) return |