Permalink
Browse files

Merge pull request #863 from ehanneken/json-patch

Added support for application/json-patch content type
  • Loading branch information...
2 parents 336c40a + d650dd0 commit 4e3329280b555869d716ab932e2fcfd9a8b64c16 @thecodejunkie thecodejunkie committed Dec 20, 2012
Showing with 2 additions and 0 deletions.
  1. +1 −0 src/Nancy/Json/Json.cs
  2. +1 −0 src/Nancy/Responses/DefaultJsonSerializer.cs
View
@@ -118,6 +118,7 @@ public static bool IsJsonContentType(string contentType)
var contentMimeType = contentType.Split(';')[0];
return contentMimeType.Equals("application/json", StringComparison.InvariantCultureIgnoreCase) ||
+ contentMimeType.StartsWith("application/json-", StringComparison.InvariantCultureIgnoreCase) ||
contentMimeType.Equals("text/json", StringComparison.InvariantCultureIgnoreCase) ||
(contentMimeType.StartsWith("application/vnd", StringComparison.InvariantCultureIgnoreCase) &&
contentMimeType.EndsWith("+json", StringComparison.InvariantCultureIgnoreCase));
@@ -67,6 +67,7 @@ private static bool IsJsonType(string contentType)
var contentMimeType = contentType.Split(';')[0];
return contentMimeType.Equals("application/json", StringComparison.InvariantCultureIgnoreCase) ||
+ contentMimeType.StartsWith("application/json-", StringComparison.InvariantCultureIgnoreCase) ||
contentMimeType.Equals("text/json", StringComparison.InvariantCultureIgnoreCase) ||
(contentMimeType.StartsWith("application/vnd", StringComparison.InvariantCultureIgnoreCase) &&
contentMimeType.EndsWith("+json", StringComparison.InvariantCultureIgnoreCase));

0 comments on commit 4e33292

Please sign in to comment.