aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline/Formatters
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-02-11 22:21:12 +0800
committercrupest <crupest@outlook.com>2021-02-11 22:21:12 +0800
commit410032dbbc69e161ace03d68fea1934269c984ba (patch)
treed23f6b1e00a7002d59f4265b9e94306a33fd9991 /BackEnd/Timeline/Formatters
parent840927cc6fe826f25de165da84876e8e676106a8 (diff)
downloadtimeline-410032dbbc69e161ace03d68fea1934269c984ba.tar.gz
timeline-410032dbbc69e161ace03d68fea1934269c984ba.tar.bz2
timeline-410032dbbc69e161ace03d68fea1934269c984ba.zip
...
Diffstat (limited to 'BackEnd/Timeline/Formatters')
-rw-r--r--BackEnd/Timeline/Formatters/ByteDataInputFormatter.cs6
1 files changed, 6 insertions, 0 deletions
diff --git a/BackEnd/Timeline/Formatters/ByteDataInputFormatter.cs b/BackEnd/Timeline/Formatters/ByteDataInputFormatter.cs
index 2451ead6..49f8221a 100644
--- a/BackEnd/Timeline/Formatters/ByteDataInputFormatter.cs
+++ b/BackEnd/Timeline/Formatters/ByteDataInputFormatter.cs
@@ -44,6 +44,12 @@ namespace Timeline.Formatters
var logger = context.HttpContext.RequestServices.GetRequiredService<ILogger<ByteDataInputFormatter>>();
+ if (request.ContentType is null)
+ {
+ logger.LogInformation("Failed to read body as bytes. Content-Type is not set.");
+ return await InputFormatterResult.FailureAsync();
+ }
+
if (contentLength == null)
{
logger.LogInformation("Failed to read body as bytes. Content-Length is not set.");