fix
This commit is contained in:
@@ -507,7 +507,11 @@ public class ApiServer : IApiServer
|
|||||||
// Read input content
|
// Read input content
|
||||||
Log.Debug("Read input content");
|
Log.Debug("Read input content");
|
||||||
ApiMessage? message = null;
|
ApiMessage? message = null;
|
||||||
switch (context.Request.ContentType)
|
var contentType = context.Request.ContentType;
|
||||||
|
var contentTypeEnd = contentType?.IndexOf(';') ?? -1;
|
||||||
|
if (contentType != null && contentTypeEnd != -1)
|
||||||
|
contentType = contentType[..contentTypeEnd];
|
||||||
|
switch (contentType)
|
||||||
{
|
{
|
||||||
case "application/json":
|
case "application/json":
|
||||||
try
|
try
|
||||||
@@ -515,9 +519,8 @@ public class ApiServer : IApiServer
|
|||||||
Log.Debug("Deserialize message");
|
Log.Debug("Deserialize message");
|
||||||
using StreamReader input = new(context.Request.InputStream);
|
using StreamReader input = new(context.Request.InputStream);
|
||||||
var contentJson = input.ReadToEnd();
|
var contentJson = input.ReadToEnd();
|
||||||
if (targetType == null)
|
if (targetType != null)
|
||||||
return null;
|
message = serializer.Deserialize(contentJson, targetType);
|
||||||
message = serializer.Deserialize(contentJson, targetType);
|
|
||||||
}
|
}
|
||||||
catch (OutOfMemoryException)
|
catch (OutOfMemoryException)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Version>2.11.3</Version>
|
<Version>2.11.4</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
Reference in New Issue
Block a user