fix: return correct mimetype for openapi docs.json

Resolves https://github.com/go-vikunja/vikunja/issues/864
This commit is contained in:
kolaente
2025-06-04 16:12:46 +02:00
parent 910f4ba54f
commit 44b3e46325

View File

@@ -36,13 +36,8 @@ func DocsJSON(c echo.Context) error {
log.Error(err.Error())
return echo.NewHTTPError(http.StatusInternalServerError).SetInternal(err)
}
_, err = c.Response().Write([]byte(doc))
if err != nil {
log.Error(err.Error())
return echo.NewHTTPError(http.StatusInternalServerError).SetInternal(err)
}
return nil
return c.Blob(http.StatusOK, echo.MIMEApplicationJSON, []byte(doc))
}
// RedocUI serves everything needed to provide the redoc ui