Skip to content

Commit ec93757

Browse files
committed
JSONRPC_Request.id updated to optional following the specification at https://www.jsonrpc.org/specification
1 parent 0fe63f8 commit ec93757

File tree

8 files changed

+8
-13
lines changed

8 files changed

+8
-13
lines changed

rls/API.Library.dll

0 Bytes
Binary file not shown.

rls/API.Library.pdb

0 Bytes
Binary file not shown.

src/API.Library/Entities/JSONRPC.cs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,12 @@ public void ProcessRequest(HttpContext context)
125125
if (result == null)
126126
{
127127
JSONRPC_Error error = new JSONRPC_Error { code = -32603 };
128-
this.ParseError(ref context, JSONRPC_Request.id.ToString(), error);
128+
this.ParseError(ref context, JSONRPC_Request.id, error);
129129
}
130130
else if (result.error != null)
131131
{
132132
JSONRPC_Error error = new JSONRPC_Error { code = -32099, message = result.error };
133-
this.ParseError(ref context, JSONRPC_Request.id.ToString(), error);
133+
this.ParseError(ref context, JSONRPC_Request.id, error);
134134
}
135135
else
136136
{
@@ -172,7 +172,7 @@ public void ProcessRequest(HttpContext context)
172172
/// <param name="response"></param>
173173
/// <param name="id"></param>
174174
/// <param name="error"></param>
175-
private void ParseError(ref HttpContext context, string id, JSONRPC_Error error)
175+
private void ParseError(ref HttpContext context, object id, JSONRPC_Error error)
176176
{
177177
if (error.message == null)
178178
switch (error.code.ToString())
@@ -275,12 +275,7 @@ private JSONRPC_Request ParseRequest(ref HttpContext context)
275275
this.ParseError(ref context, null, error);
276276
}
277277

278-
// Validate the request
279-
if (JSONRPC_Request.id == null)
280-
{
281-
JSONRPC_Error error = new JSONRPC_Error { code = -32600 };
282-
this.ParseError(ref context, null, error);
283-
}
278+
// N.B. JSONRPC_Request.id is recommended but optional anyway
284279

285280
// Validate the request
286281
if (JSONRPC_Request.jsonrpc == null

src/API.Library/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("3.0.1.0")]
36-
[assembly: AssemblyFileVersion("3.0.1.0")]
35+
[assembly: AssemblyVersion("3.0.2.0")]
36+
[assembly: AssemblyFileVersion("3.0.2.0")]
3737

3838
// Configure log4net using the Web.config file by default
3939
[assembly: log4net.Config.XmlConfigurator(Watch = true)]

test/API.Test/API.Test.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@
7171
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
7272
</PropertyGroup>
7373
<ItemGroup>
74-
<Reference Include="API.Library, Version=3.0.1.0, Culture=neutral, processorArchitecture=MSIL">
74+
<Reference Include="API.Library, Version=3.0.2.0, Culture=neutral, processorArchitecture=MSIL">
7575
<SpecificVersion>False</SpecificVersion>
76-
<HintPath>..\packages\API.Library.3.0.1\API.Library.dll</HintPath>
76+
<HintPath>..\packages\API.Library.3.0.2\API.Library.dll</HintPath>
7777
</Reference>
7878
<Reference Include="Enyim.Caching, Version=2.16.0.0, Culture=neutral, PublicKeyToken=cec98615db04012e, processorArchitecture=MSIL">
7979
<HintPath>..\packages\EnyimMemcached.2.16.0\lib\net35\Enyim.Caching.dll</HintPath>

0 commit comments

Comments
 (0)