diff --git a/WireMock.Net Solution.sln b/WireMock.Net Solution.sln
index 1c3c8853..b6162721 100644
--- a/WireMock.Net Solution.sln
+++ b/WireMock.Net Solution.sln
@@ -42,7 +42,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WireMock.Net.StandAlone.Net
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WireMock.Net.Console.NET452", "examples\WireMock.Net.ConsoleApplication\WireMock.Net.Console.NET452.csproj", "{668F689E-57B4-422E-8846-C0FF643CA268}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WireMock.Net.WebApplication", "examples\WireMock.Net.WebApplication\WireMock.Net.WebApplication.csproj", "{049539C1-7A66-4559-AD7A-B1C73B97CBB0}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WireMock.Net.WebApplication.NETCore2", "examples\WireMock.Net.WebApplication\WireMock.Net.WebApplication.NETCore2.csproj", "{049539C1-7A66-4559-AD7A-B1C73B97CBB0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WireMock.Net.Console.Proxy.Net452", "examples\WireMock.Net.Console.Proxy.Net452\WireMock.Net.Console.Proxy.Net452.csproj", "{26433A8F-BF01-4962-97EB-81BFFBB61096}"
EndProject
diff --git a/examples/WireMock.Net.StandAlone.NETCoreApp/WireMock.Net.StandAlone.NETCoreApp.csproj b/examples/WireMock.Net.StandAlone.NETCoreApp/WireMock.Net.StandAlone.NETCoreApp.csproj
index 5b2ac302..8dc82ad6 100644
--- a/examples/WireMock.Net.StandAlone.NETCoreApp/WireMock.Net.StandAlone.NETCoreApp.csproj
+++ b/examples/WireMock.Net.StandAlone.NETCoreApp/WireMock.Net.StandAlone.NETCoreApp.csproj
@@ -2,8 +2,9 @@
Exe
- netcoreapp2.0;netcoreapp1.1
+ netcoreapp2.1;netcoreapp2.0;netcoreapp1.1
../../WireMock.Net-Logo.ico
+ WireMock.Net.StandAlone.NETCoreApp.Program
diff --git a/examples/WireMock.Net.StandAlone.NETCoreApp/run1.cmd b/examples/WireMock.Net.StandAlone.NETCoreApp/run10.cmd
similarity index 100%
rename from examples/WireMock.Net.StandAlone.NETCoreApp/run1.cmd
rename to examples/WireMock.Net.StandAlone.NETCoreApp/run10.cmd
diff --git a/examples/WireMock.Net.StandAlone.NETCoreApp/run2.cmd b/examples/WireMock.Net.StandAlone.NETCoreApp/run20.cmd
similarity index 100%
rename from examples/WireMock.Net.StandAlone.NETCoreApp/run2.cmd
rename to examples/WireMock.Net.StandAlone.NETCoreApp/run20.cmd
diff --git a/examples/WireMock.Net.StandAlone.NETCoreApp/run21.cmd b/examples/WireMock.Net.StandAlone.NETCoreApp/run21.cmd
new file mode 100644
index 00000000..8dd3a9bb
--- /dev/null
+++ b/examples/WireMock.Net.StandAlone.NETCoreApp/run21.cmd
@@ -0,0 +1 @@
+dotnet run --framework netcoreapp2.1
\ No newline at end of file
diff --git a/examples/WireMock.Net.WebApplication/Properties/PublishProfiles/IIS Localhost 1.pubxml b/examples/WireMock.Net.WebApplication/Properties/PublishProfiles/IIS Localhost 1.pubxml
new file mode 100644
index 00000000..df22ade6
--- /dev/null
+++ b/examples/WireMock.Net.WebApplication/Properties/PublishProfiles/IIS Localhost 1.pubxml
@@ -0,0 +1,31 @@
+
+
+
+
+ MSDeploy
+ Debug
+ Any CPU
+
+ True
+ False
+ netcoreapp2.0
+ win10-x64
+ 049539c1-7a66-4559-ad7a-b1c73b97cbb0
+ true
+ <_IsPortable>false
+ localhost
+ Default Web Site/wiremock1
+
+ True
+ InProc
+ False
+
+ <_SavePWD>False
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/WireMock.Net.WebApplication/Properties/PublishProfiles/IIS Localhost 2.pubxml b/examples/WireMock.Net.WebApplication/Properties/PublishProfiles/IIS Localhost 2.pubxml
new file mode 100644
index 00000000..e011abc5
--- /dev/null
+++ b/examples/WireMock.Net.WebApplication/Properties/PublishProfiles/IIS Localhost 2.pubxml
@@ -0,0 +1,31 @@
+
+
+
+
+ MSDeploy
+ Debug
+ Any CPU
+
+ True
+ False
+ netcoreapp2.0
+ win10-x64
+ 049539c1-7a66-4559-ad7a-b1c73b97cbb1
+ true
+ <_IsPortable>false
+ localhost
+ Default Web Site/wiremock2
+
+ True
+ InProc
+ False
+
+ <_SavePWD>False
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/WireMock.Net.WebApplication/Properties/launchSettings.json b/examples/WireMock.Net.WebApplication/Properties/launchSettings.json
index b056cf7a..fd7a2608 100644
--- a/examples/WireMock.Net.WebApplication/Properties/launchSettings.json
+++ b/examples/WireMock.Net.WebApplication/Properties/launchSettings.json
@@ -2,6 +2,10 @@
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
+ "iis": {
+ "applicationUrl": "http://localhost//wiremock",
+ "sslPort": 0
+ },
"iisExpress": {
"applicationUrl": "http://localhost:56513/",
"sslPort": 0
@@ -23,6 +27,12 @@
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "http://localhost:56514/"
+ },
+ "IIS": {
+ "commandName": "IIS",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "development"
+ }
}
}
}
\ No newline at end of file
diff --git a/examples/WireMock.Net.WebApplication/WireMock.Net.WebApplication.csproj b/examples/WireMock.Net.WebApplication/WireMock.Net.WebApplication.NETCore2.csproj
similarity index 75%
rename from examples/WireMock.Net.WebApplication/WireMock.Net.WebApplication.csproj
rename to examples/WireMock.Net.WebApplication/WireMock.Net.WebApplication.NETCore2.csproj
index 2df47b45..8269e247 100644
--- a/examples/WireMock.Net.WebApplication/WireMock.Net.WebApplication.csproj
+++ b/examples/WireMock.Net.WebApplication/WireMock.Net.WebApplication.NETCore2.csproj
@@ -1,17 +1,16 @@
-
+
netcoreapp2.0
win10-x64
+ WireMock.Net.WebApplication.Program
+ WireMock.Net.WebApplication
+ WireMock.Net.WebApplication
-
-
-
-
-
+
diff --git a/examples/WireMock.Net.WebApplication/readme.md b/examples/WireMock.Net.WebApplication/readme.md
new file mode 100644
index 00000000..61d5b1a3
--- /dev/null
+++ b/examples/WireMock.Net.WebApplication/readme.md
@@ -0,0 +1,21 @@
+# Running in IIS
+
+Follow these links / steps:
+* https://weblog.west-wind.com/posts/2016/Jun/06/Publishing-and-Running-ASPNET-Core-Applications-with-IIS
+* https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/development-time-iis-support?view=aspnetcore-2.1
+* Create a `web.config` file
+
+## IIS Sites
+
+
+## App Pool settings
+
+
+## Publish Profiles
+Two example publish profiles are created:
+* [IIS Localhost 1](./Properties/PublishProfiles/IIS%20Localhost%201.pubxml)
+* [IIS Localhost 2](./Properties/PublishProfiles/IIS%20Localhost%202.pubxml)
+
+## Debugging
+Select the debug "IIS" if you want to debug in IIS.
+
diff --git a/examples/WireMock.Net.WebApplication/resources/iis-apppool.png b/examples/WireMock.Net.WebApplication/resources/iis-apppool.png
new file mode 100644
index 00000000..119df195
Binary files /dev/null and b/examples/WireMock.Net.WebApplication/resources/iis-apppool.png differ
diff --git a/examples/WireMock.Net.WebApplication/resources/iis-debug.png b/examples/WireMock.Net.WebApplication/resources/iis-debug.png
new file mode 100644
index 00000000..0aa1936f
Binary files /dev/null and b/examples/WireMock.Net.WebApplication/resources/iis-debug.png differ
diff --git a/examples/WireMock.Net.WebApplication/resources/iis-wiremock1and2.png b/examples/WireMock.Net.WebApplication/resources/iis-wiremock1and2.png
new file mode 100644
index 00000000..6d50b12d
Binary files /dev/null and b/examples/WireMock.Net.WebApplication/resources/iis-wiremock1and2.png differ
diff --git a/examples/WireMock.Net.WebApplication/web.config b/examples/WireMock.Net.WebApplication/web.config
new file mode 100644
index 00000000..2417b04e
--- /dev/null
+++ b/examples/WireMock.Net.WebApplication/web.config
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/WireMock.Net.StandAlone/WireMock.Net.StandAlone.csproj b/src/WireMock.Net.StandAlone/WireMock.Net.StandAlone.csproj
index e6cb1e8f..d8d1d05e 100644
--- a/src/WireMock.Net.StandAlone/WireMock.Net.StandAlone.csproj
+++ b/src/WireMock.Net.StandAlone/WireMock.Net.StandAlone.csproj
@@ -3,7 +3,7 @@
Lightweight StandAlone Http Mocking Server for .Net.
WireMock.Net.StandAlone
- 1.0.4.4
+ 1.0.4.5
Stef Heyenrath
net452;net46;netstandard1.3;netstandard2.0
true
diff --git a/src/WireMock.Net/Admin/Requests/LogRequestModel.cs b/src/WireMock.Net/Admin/Requests/LogRequestModel.cs
index 20b4ea0a..fa9bdcb7 100644
--- a/src/WireMock.Net/Admin/Requests/LogRequestModel.cs
+++ b/src/WireMock.Net/Admin/Requests/LogRequestModel.cs
@@ -26,7 +26,17 @@ namespace WireMock.Admin.Requests
public string Path { get; set; }
///
- ///The absolete URL.
+ /// The Absolute Path.
+ ///
+ public string AbsolutePath { get; set; }
+
+ ///
+ /// Gets the url (relative).
+ ///
+ public string Url { get; set; }
+
+ ///
+ /// The absolete URL.
///
public string AbsoluteUrl { get; set; }
diff --git a/src/WireMock.Net/Models/UrlDetails.cs b/src/WireMock.Net/Models/UrlDetails.cs
new file mode 100644
index 00000000..c23f78ed
--- /dev/null
+++ b/src/WireMock.Net/Models/UrlDetails.cs
@@ -0,0 +1,51 @@
+using System;
+using WireMock.Validation;
+
+namespace WireMock.Models
+{
+ ///
+ /// UrlDetails
+ ///
+ public class UrlDetails
+ {
+ ///
+ /// Gets the url (relative).
+ ///
+ public Uri Url { get; }
+
+ ///
+ /// Gets the AbsoluteUrl.
+ ///
+ public Uri AbsoluteUrl { get; }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The URL.
+ public UrlDetails(string url) : this(new Uri(url))
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The URL.
+ public UrlDetails(Uri url) : this(url, url)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The absolute URL.
+ /// The URL (relative).
+ public UrlDetails(Uri absoluteUrl, Uri url)
+ {
+ Check.NotNull(absoluteUrl, nameof(absoluteUrl));
+ Check.NotNull(url, nameof(url));
+
+ AbsoluteUrl = absoluteUrl;
+ Url = url;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/WireMock.Net/Owin/OwinRequestMapper.cs b/src/WireMock.Net/Owin/OwinRequestMapper.cs
index d8df15c3..57211735 100644
--- a/src/WireMock.Net/Owin/OwinRequestMapper.cs
+++ b/src/WireMock.Net/Owin/OwinRequestMapper.cs
@@ -31,10 +31,10 @@ namespace WireMock.Owin
)
{
#if !NETSTANDARD
- Uri url = request.Uri;
+ var urldetails = UrlUtils.Parse(request.Uri, request.PathBase);
string clientIP = request.RemoteIpAddress;
#else
- Uri url = new Uri(request.GetEncodedUrl());
+ var urldetails = UrlUtils.Parse(new Uri(request.GetEncodedUrl()), request.PathBase);
var connection = request.HttpContext.Connection;
string clientIP = connection.RemoteIpAddress.IsIPv4MappedToIPv6
? connection.RemoteIpAddress.MapToIPv4().ToString()
@@ -68,7 +68,7 @@ namespace WireMock.Owin
body = await BodyParser.Parse(request.Body, request.ContentType);
}
- return new RequestMessage(url, method, clientIP, body, headers, cookies) { DateTime = DateTime.Now };
+ return new RequestMessage(urldetails, method, clientIP, body, headers, cookies) { DateTime = DateTime.Now };
}
private bool ShouldParseBody(string method)
diff --git a/src/WireMock.Net/RequestMessage.cs b/src/WireMock.Net/RequestMessage.cs
index bd5126ae..f60f520f 100644
--- a/src/WireMock.Net/RequestMessage.cs
+++ b/src/WireMock.Net/RequestMessage.cs
@@ -4,13 +4,14 @@ using System.Linq;
using System.Text;
using System.Net;
using JetBrains.Annotations;
+using WireMock.Models;
using WireMock.Util;
using WireMock.Validation;
namespace WireMock
{
///
- /// The request.
+ /// The RequestMessage.
///
public class RequestMessage
{
@@ -20,25 +21,40 @@ namespace WireMock
public string ClientIP { get; }
///
- /// Gets the url.
+ /// Gets the url (relative).
///
public string Url { get; }
+ ///
+ /// Gets the AbsoluteUrl.
+ ///
+ public string AbsoluteUrl { get; }
+
///
/// Gets the DateTime.
///
public DateTime DateTime { get; set; }
///
- /// Gets the path.
+ /// Gets the path (relative).
///
public string Path { get; }
+ ///
+ /// Gets the AbsolutePath.
+ ///
+ public string AbsolutePath { get; }
+
///
/// Gets the path segments.
///
public string[] PathSegments { get; }
+ ///
+ /// Gets the absolute path segments.
+ ///
+ public string[] AbsolutePathSegments { get; }
+
///
/// Gets the method.
///
@@ -107,25 +123,30 @@ namespace WireMock
///
/// Initializes a new instance of the class.
///
- /// The original url.
+ /// The original url details.
/// The HTTP method.
/// The client IP Address.
/// The body.
/// The headers.
/// The cookies.
- public RequestMessage([NotNull] Uri url, [NotNull] string method, [NotNull] string clientIP, [CanBeNull] BodyData body = null, [CanBeNull] IDictionary headers = null, [CanBeNull] IDictionary cookies = null)
+ public RequestMessage([NotNull] UrlDetails urlDetails, [NotNull] string method, [NotNull] string clientIP, [CanBeNull] BodyData body = null, [CanBeNull] IDictionary headers = null, [CanBeNull] IDictionary cookies = null)
{
- Check.NotNull(url, nameof(url));
+ Check.NotNull(urlDetails, nameof(urlDetails));
Check.NotNull(method, nameof(method));
Check.NotNull(clientIP, nameof(clientIP));
- Url = url.ToString();
- Protocol = url.Scheme;
- Host = url.Host;
- Port = url.Port;
- Origin = $"{url.Scheme}://{url.Host}:{url.Port}";
- Path = WebUtility.UrlDecode(url.AbsolutePath);
+ AbsoluteUrl = urlDetails.AbsoluteUrl.ToString();
+ Url = urlDetails.Url.ToString();
+ Protocol = urlDetails.Url.Scheme;
+ Host = urlDetails.Url.Host;
+ Port = urlDetails.Url.Port;
+ Origin = $"{Protocol}://{Host}:{Port}";
+
+ AbsolutePath = WebUtility.UrlDecode(urlDetails.AbsoluteUrl.AbsolutePath);
+ Path = WebUtility.UrlDecode(urlDetails.Url.AbsolutePath);
PathSegments = Path.Split('/').Skip(1).ToArray();
+ AbsolutePathSegments = AbsolutePath.Split('/').Skip(1).ToArray();
+
Method = method.ToLower();
ClientIP = clientIP;
@@ -136,7 +157,7 @@ namespace WireMock
Headers = headers?.ToDictionary(header => header.Key, header => new WireMockList(header.Value));
Cookies = cookies;
- RawQuery = WebUtility.UrlDecode(url.Query);
+ RawQuery = WebUtility.UrlDecode(urlDetails.Url.Query);
Query = ParseQuery(RawQuery);
}
diff --git a/src/WireMock.Net/Serialization/LogEntryMapper.cs b/src/WireMock.Net/Serialization/LogEntryMapper.cs
index cfa27736..ee4a539b 100644
--- a/src/WireMock.Net/Serialization/LogEntryMapper.cs
+++ b/src/WireMock.Net/Serialization/LogEntryMapper.cs
@@ -17,7 +17,9 @@ namespace WireMock.Serialization
DateTime = logEntry.RequestMessage.DateTime,
ClientIP = logEntry.RequestMessage.ClientIP,
Path = logEntry.RequestMessage.Path,
- AbsoluteUrl = logEntry.RequestMessage.Url,
+ AbsolutePath = logEntry.RequestMessage.AbsolutePath,
+ Url = logEntry.RequestMessage.Url,
+ AbsoluteUrl = logEntry.RequestMessage.AbsoluteUrl,
Query = logEntry.RequestMessage.Query,
Method = logEntry.RequestMessage.Method,
Body = logEntry.RequestMessage.Body,
diff --git a/src/WireMock.Net/Server/FluentMockServer.cs b/src/WireMock.Net/Server/FluentMockServer.cs
index 5dc0f1af..f4df8a4c 100644
--- a/src/WireMock.Net/Server/FluentMockServer.cs
+++ b/src/WireMock.Net/Server/FluentMockServer.cs
@@ -273,8 +273,7 @@ namespace WireMock.Server
public void Stop()
{
var result = _httpServer?.StopAsync();
- if (result != null)
- result.Wait(); //wait for stop to actually happen
+ result?.Wait(); // wait for stop to actually happen
}
#endregion
diff --git a/src/WireMock.Net/Util/UrlUtils.cs b/src/WireMock.Net/Util/UrlUtils.cs
new file mode 100644
index 00000000..7ccb08f9
--- /dev/null
+++ b/src/WireMock.Net/Util/UrlUtils.cs
@@ -0,0 +1,38 @@
+using System;
+using JetBrains.Annotations;
+using WireMock.Models;
+#if !NETSTANDARD
+using Microsoft.Owin;
+#else
+using Microsoft.AspNetCore.Http;
+#endif
+
+namespace WireMock.Util
+{
+ internal static class UrlUtils
+ {
+ public static UrlDetails Parse([NotNull] Uri uri, PathString pathBase)
+ {
+ if (!pathBase.HasValue)
+ {
+ return new UrlDetails(uri, uri);
+ }
+
+ var builder = new UriBuilder(uri);
+ builder.Path = RemoveFirst(builder.Path, pathBase.Value);
+
+ return new UrlDetails(uri, builder.Uri);
+ }
+
+ private static string RemoveFirst(string text, string search)
+ {
+ int pos = text.IndexOf(search);
+ if (pos < 0)
+ {
+ return text;
+ }
+
+ return text.Substring(0, pos) + text.Substring(pos + search.Length);
+ }
+ }
+}
diff --git a/src/WireMock.Net/WireMock.Net.csproj b/src/WireMock.Net/WireMock.Net.csproj
index ac18e8c9..0c844251 100644
--- a/src/WireMock.Net/WireMock.Net.csproj
+++ b/src/WireMock.Net/WireMock.Net.csproj
@@ -3,7 +3,7 @@
Lightweight Http Mocking Server for .Net, inspired by WireMock from the Java landscape.
WireMock.Net
- 1.0.4.4
+ 1.0.4.5
Stef Heyenrath
net452;net46;netstandard1.3;netstandard2.0
true
diff --git a/test/WireMock.Net.Tests/Http/HttpRequestMessageHelperTests.cs b/test/WireMock.Net.Tests/Http/HttpRequestMessageHelperTests.cs
index 56453bea..c2c8b1ed 100644
--- a/test/WireMock.Net.Tests/Http/HttpRequestMessageHelperTests.cs
+++ b/test/WireMock.Net.Tests/Http/HttpRequestMessageHelperTests.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Text;
using NFluent;
using WireMock.Http;
+using WireMock.Models;
using WireMock.Util;
using Xunit;
@@ -21,7 +22,7 @@ namespace WireMock.Net.Tests.Http
{
BodyAsString = "hello"
};
- var request = new RequestMessage(new Uri("http://localhost/foo"), "PUT", ClientIp, body, headers);
+ var request = new RequestMessage(new UrlDetails("http://localhost/foo"), "PUT", ClientIp, body, headers);
// Act
var message = HttpRequestMessageHelper.Create(request, "http://url");
@@ -38,7 +39,7 @@ namespace WireMock.Net.Tests.Http
{
BodyAsBytes = Encoding.UTF8.GetBytes("hi")
};
- var request = new RequestMessage(new Uri("http://localhost/foo"), "GET", ClientIp, body);
+ var request = new RequestMessage(new UrlDetails("http://localhost/foo"), "GET", ClientIp, body);
// Act
var message = HttpRequestMessageHelper.Create(request, "http://url");
@@ -55,7 +56,7 @@ namespace WireMock.Net.Tests.Http
{
BodyAsJson = new { x = 42 }
};
- var request = new RequestMessage(new Uri("http://localhost/foo"), "GET", ClientIp, body);
+ var request = new RequestMessage(new UrlDetails("http://localhost/foo"), "GET", ClientIp, body);
// Act
var message = HttpRequestMessageHelper.Create(request, "http://url");
@@ -73,7 +74,7 @@ namespace WireMock.Net.Tests.Http
{
BodyAsJson = new { x = 42 }
};
- var request = new RequestMessage(new Uri("http://localhost/foo"), "GET", ClientIp, body, headers);
+ var request = new RequestMessage(new UrlDetails("http://localhost/foo"), "GET", ClientIp, body, headers);
// Act
var message = HttpRequestMessageHelper.Create(request, "http://url");
@@ -92,7 +93,7 @@ namespace WireMock.Net.Tests.Http
{
BodyAsString = "hello"
};
- var request = new RequestMessage(new Uri("http://localhost/foo"), "PUT", ClientIp, body, headers);
+ var request = new RequestMessage(new UrlDetails("http://localhost/foo"), "PUT", ClientIp, body, headers);
// Act
var message = HttpRequestMessageHelper.Create(request, "http://url");
@@ -110,7 +111,7 @@ namespace WireMock.Net.Tests.Http
{
BodyAsString = "hello"
};
- var request = new RequestMessage(new Uri("http://localhost/foo"), "PUT", ClientIp, body, headers);
+ var request = new RequestMessage(new UrlDetails("http://localhost/foo"), "PUT", ClientIp, body, headers);
// Act
var message = HttpRequestMessageHelper.Create(request, "http://url");
@@ -128,7 +129,7 @@ namespace WireMock.Net.Tests.Http
{
BodyAsString = "hello"
};
- var request = new RequestMessage(new Uri("http://localhost/foo"), "PUT", ClientIp, body, headers);
+ var request = new RequestMessage(new UrlDetails("http://localhost/foo"), "PUT", ClientIp, body, headers);
// Act
var message = HttpRequestMessageHelper.Create(request, "http://url");
diff --git a/test/WireMock.Net.Tests/RequestCookieTests.cs b/test/WireMock.Net.Tests/RequestCookieTests.cs
index 84392417..9acba459 100644
--- a/test/WireMock.Net.Tests/RequestCookieTests.cs
+++ b/test/WireMock.Net.Tests/RequestCookieTests.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using NFluent;
using WireMock.Matchers.Request;
+using WireMock.Models;
using WireMock.RequestBuilders;
using Xunit;
@@ -18,7 +19,7 @@ namespace WireMock.Net.Tests
var spec = Request.Create().UsingAnyMethod().WithCookie("session", "a*");
// when
- var request = new RequestMessage(new Uri("http://localhost/foo"), "PUT", ClientIp, null, null, new Dictionary { { "session", "abc" } });
+ var request = new RequestMessage(new UrlDetails("http://localhost/foo"), "PUT", ClientIp, null, null, new Dictionary { { "session", "abc" } });
// then
var requestMatchResult = new RequestMatchResult();
diff --git a/test/WireMock.Net.Tests/RequestMatchers/RequestMessageBodyMatcherTests.cs b/test/WireMock.Net.Tests/RequestMatchers/RequestMessageBodyMatcherTests.cs
index 0b6a4ab2..d5cd891e 100644
--- a/test/WireMock.Net.Tests/RequestMatchers/RequestMessageBodyMatcherTests.cs
+++ b/test/WireMock.Net.Tests/RequestMatchers/RequestMessageBodyMatcherTests.cs
@@ -3,6 +3,7 @@ using Moq;
using NFluent;
using WireMock.Matchers;
using WireMock.Matchers.Request;
+using WireMock.Models;
using WireMock.Util;
using Xunit;
@@ -21,7 +22,7 @@ namespace WireMock.Net.Tests.RequestMatchers
var stringMatcherMock = new Mock();
stringMatcherMock.Setup(m => m.IsMatch(It.IsAny())).Returns(0.5d);
- var requestMessage = new RequestMessage(new Uri("http://localhost"), "GET", "127.0.0.1", body);
+ var requestMessage = new RequestMessage(new UrlDetails("http://localhost"), "GET", "127.0.0.1", body);
var matcher = new RequestMessageBodyMatcher(stringMatcherMock.Object);
@@ -48,7 +49,7 @@ namespace WireMock.Net.Tests.RequestMatchers
var stringMatcherMock = new Mock();
stringMatcherMock.Setup(m => m.IsMatch(It.IsAny())).Returns(0.5d);
- var requestMessage = new RequestMessage(new Uri("http://localhost"), "GET", "127.0.0.1", body);
+ var requestMessage = new RequestMessage(new UrlDetails("http://localhost"), "GET", "127.0.0.1", body);
var matcher = new RequestMessageBodyMatcher(stringMatcherMock.Object);
@@ -75,7 +76,7 @@ namespace WireMock.Net.Tests.RequestMatchers
var stringMatcherMock = new Mock();
stringMatcherMock.Setup(m => m.IsMatch(It.IsAny())).Returns(0.5d);
- var requestMessage = new RequestMessage(new Uri("http://localhost"), "GET", "127.0.0.1", body);
+ var requestMessage = new RequestMessage(new UrlDetails("http://localhost"), "GET", "127.0.0.1", body);
var matcher = new RequestMessageBodyMatcher(stringMatcherMock.Object);
@@ -102,7 +103,7 @@ namespace WireMock.Net.Tests.RequestMatchers
var stringMatcherMock = new Mock();
stringMatcherMock.Setup(m => m.IsMatch(It.IsAny())).Returns(0.5d);
- var requestMessage = new RequestMessage(new Uri("http://localhost"), "GET", "127.0.0.1", body);
+ var requestMessage = new RequestMessage(new UrlDetails("http://localhost"), "GET", "127.0.0.1", body);
var matcher = new RequestMessageBodyMatcher(stringMatcherMock.Object);
@@ -128,7 +129,7 @@ namespace WireMock.Net.Tests.RequestMatchers
var objectMatcherMock = new Mock();
objectMatcherMock.Setup(m => m.IsMatch(It.IsAny