mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 21:10:32 +01:00
[PR #294] [MERGED] don't strip request body if we don't recognize the request method #844
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/wiremock/WireMock.Net/pull/294
Author: @eli-darkly
Created: 6/29/2019
Status: ✅ Merged
Merged: 7/3/2019
Merged by: @StefH
Base:
master← Head:AllowBodyForUnknownMethods📝 Commits (2)
8ba9c40don't strip request body if we don't recognize the request method06a7395use IsNullOrEmpty📊 Changes
3 files changed (+108 additions, -2 deletions)
View changed files
📝
src/WireMock.Net/Util/BodyParser.cs(+26 -2)📝
test/WireMock.Net.Tests/FluentMockServerTests.cs(+59 -0)📝
test/WireMock.Net.Tests/Util/BodyParserTests.cs(+23 -0)📄 Description
This addresses https://github.com/WireMock-Net/WireMock.Net/issues/290 by changing the request-processing behavior from this--
--to this:
For any of the methods that were already listed in BodyParser.cs, this change has no effect: request bodies will still be discarded for GET or DELETE, preserved for POST or PUT, etc. But for methods that were not specifically mentioned there (like REPORT), the request body (if any) will be preserved. I believe this is more in line with the HTTP specification, which only says that a server should discard the body if the method is known not to allow one.
While REPORT was the method I wanted to use in my own code, I didn't bother adding it to this list because it's just one of many rarely-used methods that appear in the HTTP Method Registry.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.