Skip to content

Commit b9652e5

Browse files
committed
Don't add callback wrappers on a JSONP CompressedResult which already has them (and doesn't corrupt the gzip'd payload)
1 parent ef539ac commit b9652e5

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/ServiceStack/CacheAccess.Providers/CacheClientExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public static object ResolveFromCache(this ICacheClient cacheClient,
2424
IRequestContext context)
2525
{
2626
string modifiers = null;
27-
if (context.ContentType == ContentType.Json)
27+
if (context.ResponseContentType == ContentType.Json)
2828
{
2929
string jsonp = context.Get<IHttpRequest>().GetJsonpCallback();
3030
if (jsonp != null)
@@ -70,7 +70,7 @@ public static object Cache(this ICacheClient cacheClient,
7070
string serializedDto = EndpointHost.ContentTypeFilter.SerializeToString(context, responseDto);
7171

7272
string jsonp = null, modifiers = null;
73-
if (context.ContentType == ContentType.Json)
73+
if (context.ResponseContentType == ContentType.Json)
7474
{
7575
jsonp = context.Get<IHttpRequest>().GetJsonpCallback();
7676
if (jsonp != null)

src/ServiceStack/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@
3333
// You can specify all the values or you can default the Build and Revision Numbers
3434
// by using the '*' as shown below:
3535
// [assembly: AssemblyVersion("1.0.*")]
36-
[assembly: AssemblyVersion("3.7.1.0")]
36+
[assembly: AssemblyVersion("3.7.2.0")]

src/ServiceStack/WebHost.EndPoints/GenericHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public override void ProcessRequest(IHttpRequest httpReq, IHttpResponse httpRes,
6868
var response = GetResponse(httpReq, httpRes, request);
6969
if (EndpointHost.ApplyResponseFilters(httpReq, httpRes, response)) return;
7070

71-
if (doJsonp)
71+
if (doJsonp && !(response is CompressedResult))
7272
httpRes.WriteToResponse(httpReq, response, (callback + "(").ToUtf8Bytes(), ")".ToUtf8Bytes());
7373
else
7474
httpRes.WriteToResponse(httpReq, response);

src/ServiceStack/WebHost.EndPoints/RestHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public override void ProcessRequest(IHttpRequest httpReq, IHttpResponse httpRes,
6969
return;
7070
}
7171

72-
if(doJsonp)
72+
if (doJsonp && !(response is CompressedResult))
7373
httpRes.WriteToResponse(httpReq, response, (callback + "(").ToUtf8Bytes(), ")".ToUtf8Bytes());
7474
else
7575
httpRes.WriteToResponse(httpReq, response);

0 commit comments

Comments
 (0)