Skip to content

Commit 437b319

Browse files
committed
Mime-Type "application/json" set for the Content Type JSON-RPC response
CacheControl "no-cache" set for the JSON-RPC response
1 parent 2341f78 commit 437b319

File tree

10 files changed

+27
-16
lines changed

10 files changed

+27
-16
lines changed

rls/API.Library.dll

512 Bytes
Binary file not shown.

rls/API.Library.pdb

0 Bytes
Binary file not shown.

src/API.Library/Entities/JSONRPC.cs

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
using System;
2-
using System.Web;
3-
using System.Web.SessionState;
4-
using System.Reflection;
5-
using System.IO;
6-
using System.DirectoryServices.AccountManagement;
1+
using Newtonsoft.Json;
2+
using Newtonsoft.Json.Linq;
3+
using System;
4+
using System.Collections.Generic;
75
using System.Configuration;
6+
using System.DirectoryServices.AccountManagement;
7+
using System.IO;
88
using System.Linq;
9-
using Newtonsoft.Json;
10-
using Newtonsoft.Json.Linq;
9+
using System.Reflection;
1110
using System.Text.RegularExpressions;
12-
using System.Collections.Generic;
11+
using System.Web;
12+
using System.Web.SessionState;
1313

1414
namespace API
1515
{
@@ -24,6 +24,11 @@ public class JSONRPC : IHttpHandler, IRequiresSessionState
2424
/// </summary>
2525
const string JSONRPC_Version = "2.0";
2626

27+
/// <summary>
28+
/// JSON RPC mime-type
29+
/// </summary>
30+
const string JSONRPC_MimeType = "application/json";
31+
2732
/// <summary>
2833
/// GET request parameter
2934
/// </summary>
@@ -119,6 +124,12 @@ public void ProcessRequest(HttpContext context)
119124
{
120125
Log.Instance.Info("API Interface Opened");
121126

127+
// Set Mime-Type for the Content Type and override the Charset
128+
context.Response.ContentType = JSONRPC_MimeType;
129+
context.Response.Charset = null;
130+
// Set CacheControl to no-cache
131+
context.Response.CacheControl = "no-cache";
132+
122133
// Deserialize and parse the JSON request into an Object dynamically
123134
JSONRPC_Request JSONRPC_Request = this.ParseRequest(ref context);
124135

@@ -852,4 +863,4 @@ internal class JSONRPC_API_ResponseDataJRaw
852863

853864
#endregion
854865
}
855-
}
866+
}

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.3.0")]
36-
[assembly: AssemblyFileVersion("3.0.3.0")]
35+
[assembly: AssemblyVersion("3.0.4.0")]
36+
[assembly: AssemblyFileVersion("3.0.4.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.3.0, Culture=neutral, processorArchitecture=MSIL">
74+
<Reference Include="API.Library, Version=3.0.4.0, Culture=neutral, processorArchitecture=MSIL">
7575
<SpecificVersion>False</SpecificVersion>
76-
<HintPath>..\packages\API.Library.3.0.3\API.Library.dll</HintPath>
76+
<HintPath>..\packages\API.Library.3.0.4\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>

test/API.Test/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@
3131
//
3232
// You can specify all the values or you can default the Revision and Build Numbers
3333
// by using the '*' as shown below:
34-
[assembly: AssemblyVersion("3.0.1.0")]
35-
[assembly: AssemblyFileVersion("3.0.1.0")]
34+
[assembly: AssemblyVersion("3.0.4.0")]
35+
[assembly: AssemblyFileVersion("3.0.4.0")]
Binary file not shown.
60.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)