diff --git a/TShockAPI/Rest/Rest.cs b/TShockAPI/Rest/Rest.cs index 4fbf94e4..17c032cd 100644 --- a/TShockAPI/Rest/Rest.cs +++ b/TShockAPI/Rest/Rest.cs @@ -157,7 +157,8 @@ namespace Rests e.Response.Connection.Type = ConnectionType.Close; e.Response.ContentType = new ContentTypeHeader("application/json; charset=utf-8"); e.Response.Add(serverHeader); - e.Response.Body.Write(Encoding.UTF8.GetBytes(str), 0, str.Length); + var bytes = Encoding.UTF8.GetBytes(str); + e.Response.Body.Write(bytes, 0, bytes.Length); e.Response.Status = HttpStatusCode.OK; }