Skip to content

Commit 49fc906

Browse files
authored
Fixes Astn#97 (Astn#98)
* Astn#97 According to the specification for JSON-RPC over HTTP the request and response Content-Type should be one of the following: "application/json-rpc" - preferred "application/json" "application/jsonrequest" * Build server not using lastest version of c#
1 parent 7defef9 commit 49fc906

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

AustinHarris.JsonRpc.AspNet/JsonRpcHandlerBase.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ public void EndProcessRequest(IAsyncResult result)
105105
/// <param name="encoding">The Encoding to be used to encode as the result.</param>
106106
static void CompressResponseIfPossible(HttpRequest request, HttpResponse response, String result, Encoding encoding)
107107
{
108+
response.ContentType = "application/json-rpc";
108109
string acceptEncoding = request.Headers["Accept-Encoding"];
109110
if (acceptEncoding != null && acceptEncoding.Contains("gzip"))
110111
{

Json-Rpc/JsonRequest.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ public JsonRequest(string method, object pars, object id)
2020
}
2121

2222
[JsonProperty("jsonrpc")]
23-
public string JsonRpc => "2.0";
23+
public string JsonRpc
24+
{
25+
get { return "2.0"; }
26+
}
2427

2528
[JsonProperty("method")]
2629
public string Method { get; set; }

0 commit comments

Comments
 (0)