light blocks on API now use same JSON encoding as other methods

This commit is contained in:
DataHoarder 2023-07-24 12:26:40 +02:00
parent a23c30455d
commit 649640c381
Signed by: DataHoarder
SSH key fingerprint: SHA256:OLTRf6Fl87G52SiR7sWLGNzlJt4WOX+tfI2yxo0z7xk

View file

@ -1370,8 +1370,7 @@ func main() {
writer.Header().Set("Content-Type", "application/json; charset=utf-8")
writer.WriteHeader(http.StatusOK)
buf, _ := utils.MarshalJSON(raw)
_, _ = writer.Write(buf)
_ = httputils.EncodeJson(request, writer, raw)
case "/raw":
raw := p2api.LightByMainIdWithHint(block.MainId, block.TemplateId)