lil webfingy fix (#106)

* lil webfingy fix

* return requested content type from fede requests
This commit is contained in:
Tobi Smethurst
2021-07-21 17:46:59 +02:00
committed by GitHub
parent 29bdc41baa
commit 113186ce4e
6 changed files with 58 additions and 8 deletions

View File

@@ -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)
}