diff options
author | crupest <crupest@outlook.com> | 2021-02-11 22:21:12 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-02-11 22:21:12 +0800 |
commit | 410032dbbc69e161ace03d68fea1934269c984ba (patch) | |
tree | d23f6b1e00a7002d59f4265b9e94306a33fd9991 /BackEnd/Timeline/Formatters | |
parent | 840927cc6fe826f25de165da84876e8e676106a8 (diff) | |
download | timeline-410032dbbc69e161ace03d68fea1934269c984ba.tar.gz timeline-410032dbbc69e161ace03d68fea1934269c984ba.tar.bz2 timeline-410032dbbc69e161ace03d68fea1934269c984ba.zip |
...
Diffstat (limited to 'BackEnd/Timeline/Formatters')
-rw-r--r-- | BackEnd/Timeline/Formatters/ByteDataInputFormatter.cs | 6 |
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.");
|