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 | b5376f71157f68f06aa04bde79389f9ab291d84a (patch) | |
tree | 369d3a89588e752983a26baff9c225ce43ad3ef8 /BackEnd/Timeline/Formatters | |
parent | d1317bd9fe08a933a13df88ba692343cde549123 (diff) | |
download | timeline-b5376f71157f68f06aa04bde79389f9ab291d84a.tar.gz timeline-b5376f71157f68f06aa04bde79389f9ab291d84a.tar.bz2 timeline-b5376f71157f68f06aa04bde79389f9ab291d84a.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.");
|