Skip to content

Commit

Permalink
Fixed issue with DELETE http method
Browse files Browse the repository at this point in the history
  • Loading branch information
chronoxor committed Nov 18, 2020
1 parent 8812bf5 commit bd1cc20
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Specify version format
version: "5.0.0.{build}"
version: "5.0.1.{build}"

# Image to use
image: Visual Studio 2019
Expand Down
4 changes: 2 additions & 2 deletions source/NetCoreServer/HttpRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -800,8 +800,8 @@ internal bool ReceiveBody(byte[] buffer, int offset, int size)
// Update body size
_bodySize += size;

// GET request has no body
if ((Method == "HEAD") || (Method == "GET") || (Method == "OPTIONS") || (Method == "TRACE"))
// HEAD/GET/DELETE/OPTIONS/TRACE request might have no body
if ((Method == "HEAD") || (Method == "GET") || ((Method == "DELETE") && !_bodyLengthProvided) || (Method == "OPTIONS") || (Method == "TRACE"))
{
_bodyLength = 0;
_bodySize = 0;
Expand Down
2 changes: 1 addition & 1 deletion source/NetCoreServer/NetCoreServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<Version>5.0.0.0</Version>
<Version>5.0.1.0</Version>
<Authors>Ivan Shynkarenka</Authors>
<Copyright>Copyright (c) 2019-2020 Ivan Shynkarenka</Copyright>
<RepositoryUrl>https://github.com/chronoxor/NetCoreServer</RepositoryUrl>
Expand Down
9 changes: 0 additions & 9 deletions www/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,6 @@ paths:
schema:
type: string
example: 'test'
requestBody:
required: false
content:
application/json:
type: object
schema:
type: string
nullable: true
example: null
responses:
200:
description: Success
Expand Down

0 comments on commit bd1cc20

Please sign in to comment.