From dd9547d865d57ad13bb83a01130a413dabc8664a Mon Sep 17 00:00:00 2001 From: Jawsh Date: Mon, 8 Dec 2014 01:43:56 -0800 Subject: [PATCH] Update JsonpMediaTypeFormatter.cs Line 104: Modification to process non-jsonp requests within the same context. i.e. POST, PUT, PATCH, DELETE, etc. Currently, it will throw the InvalidOperationException if a callback is not present, thus failing non-GET requests. --- src/WebApiContrib.Formatting.Jsonp/JsonpMediaTypeFormatter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WebApiContrib.Formatting.Jsonp/JsonpMediaTypeFormatter.cs b/src/WebApiContrib.Formatting.Jsonp/JsonpMediaTypeFormatter.cs index 307d6b3..80ea4b5 100644 --- a/src/WebApiContrib.Formatting.Jsonp/JsonpMediaTypeFormatter.cs +++ b/src/WebApiContrib.Formatting.Jsonp/JsonpMediaTypeFormatter.cs @@ -101,7 +101,7 @@ public override MediaTypeFormatter GetPerRequestFormatterInstance(Type type, Htt return new JsonpMediaTypeFormatter(request, callback, _jsonMediaTypeFormatter, _callbackQueryParameter); } - throw new InvalidOperationException(Properties.Resources.NoCallback); + return new JsonpMediaTypeFormatter(_jsonMediaTypeFormatter); } ///