Skip to content
This repository was archived by the owner on Jan 5, 2026. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
Expand All @@ -24,7 +24,9 @@ public async Task Invoke(HttpContext httpContext)
{
var request = httpContext.Request;

if (request.Method == "POST" && request.ContentType.StartsWith("application/json"))
if (request.Method == "POST"
&& !string.IsNullOrEmpty(request.ContentType)
&& request.ContentType.StartsWith("application/json"))
{
var items = httpContext.Items;
request.EnableBuffering();
Expand Down