mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-03-14 06:17:11 +01:00
Fixed bug 301 by not setting BodyAsFile to null after first use (#302)
* Fixed bug 301 by not setting BodyAsFile to null after first use * Added extra unit test * 1.0.24.0
This commit is contained in:
committed by
Stef Heyenrath
parent
af46a490a5
commit
7201479439
@@ -4,7 +4,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<VersionPrefix>1.0.23</VersionPrefix>
|
||||
<VersionPrefix>1.0.24</VersionPrefix>
|
||||
</PropertyGroup>
|
||||
|
||||
<Choose>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
https://github.com/StefH/GitHubReleaseNotes
|
||||
|
||||
GitHubReleaseNotes.exe --output CHANGELOG.md --skip-empty-releases --version 1.0.23.0
|
||||
GitHubReleaseNotes.exe --output CHANGELOG.md --skip-empty-releases --version 1.0.24.0
|
||||
@@ -419,7 +419,6 @@ namespace WireMock.ResponseBuilders
|
||||
if (!UseTransformer && ResponseMessage.BodyData?.BodyAsFileIsCached == true)
|
||||
{
|
||||
ResponseMessage.BodyData.BodyAsBytes = settings.FileSystemHandler.ReadResponseBodyAsFile(ResponseMessage.BodyData.BodyAsFile);
|
||||
ResponseMessage.BodyData.BodyAsFile = null;
|
||||
}
|
||||
|
||||
return ResponseMessage;
|
||||
|
||||
@@ -36,10 +36,14 @@ namespace WireMock.Net.Tests.ResponseBuilders
|
||||
);
|
||||
|
||||
// Act
|
||||
var response = await new HttpClient().GetStringAsync("http://localhost:" + server.Ports[0] + "/v1/content");
|
||||
var response1 = await new HttpClient().GetStringAsync("http://localhost:" + server.Ports[0] + "/v1/content");
|
||||
var response2 = await new HttpClient().GetStringAsync("http://localhost:" + server.Ports[0] + "/v1/content");
|
||||
var response3 = await new HttpClient().GetStringAsync("http://localhost:" + server.Ports[0] + "/v1/content");
|
||||
|
||||
// Assert
|
||||
response.Should().Contain("<hello>world</hello>");
|
||||
response1.Should().Contain("<hello>world</hello>");
|
||||
response2.Should().Contain("<hello>world</hello>");
|
||||
response3.Should().Contain("<hello>world</hello>");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user