diff options
Diffstat (limited to 'internal/api/s2s/user/statusget.go')
-rw-r--r-- | internal/api/s2s/user/statusget.go | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/internal/api/s2s/user/statusget.go b/internal/api/s2s/user/statusget.go index 37621d1de..04241d075 100644 --- a/internal/api/s2s/user/statusget.go +++ b/internal/api/s2s/user/statusget.go @@ -2,6 +2,8 @@ package user import ( "context" + "encoding/json" + "fmt" "net/http" "github.com/gin-gonic/gin" @@ -50,5 +52,13 @@ func (m *Module) StatusGETHandler(c *gin.Context) { return } - c.JSON(http.StatusOK, status) + b, mErr := json.Marshal(status) + if mErr != nil { + err := fmt.Errorf("could not marshal json: %s", mErr) + l.Error(err) + c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()}) + return + } + + c.Data(http.StatusOK, format, b) } |