Fixed Content-Type of web api mapping returning JSON
ln.build - build0.waldrennach.l--n.de build job pending
Details
ln.build - build0.waldrennach.l--n.de build job pending
Details
parent
c3371bb0d8
commit
f73d32f066
|
@ -53,12 +53,13 @@ namespace ln.http.api
|
|||
if (result is JSONValue jsonResult)
|
||||
return defaultResponseFactory().Content(jsonResult);
|
||||
|
||||
if (!JSONMapper.DefaultMapper.Serialize(result, out JSONValue json))
|
||||
return HttpResponse.InternalServerError().Content("Method result could not be serialized");
|
||||
|
||||
result = json;
|
||||
|
||||
return defaultResponseFactory().Content(result.ToString());
|
||||
if (JSONMapper.DefaultMapper.Serialize(result, out JSONValue json))
|
||||
return defaultResponseFactory()
|
||||
.ContentType("application/json")
|
||||
.Content(result.ToString())
|
||||
;
|
||||
|
||||
return HttpResponse.InternalServerError().Content("Method result could not be serialized");
|
||||
}
|
||||
|
||||
void MapArguments(HttpRequest request, MethodInfo methodInfo,out object[] arguments, out Func<HttpResponse> defaultRepsonseFactory)
|
||||
|
|
Loading…
Reference in New Issue