diff --git a/TShockAPI/Rest/Rest.cs b/TShockAPI/Rest/Rest.cs index 3f2ae2e2..f0578b7c 100644 --- a/TShockAPI/Rest/Rest.cs +++ b/TShockAPI/Rest/Rest.cs @@ -125,6 +125,11 @@ namespace Rests return; var str = JsonConvert.SerializeObject(obj, Formatting.Indented); + var jsonp = e.Request.Parameters["jsonp"]; + if (!string.IsNullOrWhiteSpace(jsonp)) + { + str = string.Format("{0}({1});", jsonp, str); + } e.Response.Connection.Type = ConnectionType.Close; e.Response.ContentType = new ContentTypeHeader("application/json"); e.Response.Add(serverHeader);