mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-03-20 08:35:15 +01:00
Add ClientIP to RequestMessage / RequestLog (#46)
This commit is contained in:
@@ -8,11 +8,13 @@ namespace WireMock.Net.Tests
|
||||
//[TestFixture]
|
||||
public class RequestMessageTests
|
||||
{
|
||||
private const string clientIP = "::1";
|
||||
|
||||
[Fact]
|
||||
public void Should_handle_empty_query()
|
||||
{
|
||||
// given
|
||||
var request = new RequestMessage(new Uri("http://localhost/foo"), "POST");
|
||||
var request = new RequestMessage(new Uri("http://localhost/foo"), "POST", clientIP);
|
||||
|
||||
// then
|
||||
Check.That(request.GetParameter("not_there")).IsNull();
|
||||
@@ -24,7 +26,7 @@ namespace WireMock.Net.Tests
|
||||
// given
|
||||
string bodyAsString = "whatever";
|
||||
byte[] body = Encoding.UTF8.GetBytes(bodyAsString);
|
||||
var request = new RequestMessage(new Uri("http://localhost?foo=bar&multi=1&multi=2"), "POST", body, bodyAsString, Encoding.UTF8);
|
||||
var request = new RequestMessage(new Uri("http://localhost?foo=bar&multi=1&multi=2"), "POST", clientIP, body, bodyAsString, Encoding.UTF8);
|
||||
|
||||
// then
|
||||
Check.That(request.GetParameter("foo")).Contains("bar");
|
||||
@@ -32,4 +34,4 @@ namespace WireMock.Net.Tests
|
||||
Check.That(request.GetParameter("multi")).Contains("2");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user