mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-03-18 23:33:47 +01:00
PathSegments (#114)
This commit is contained in:
@@ -34,6 +34,11 @@ namespace WireMock
|
||||
/// </summary>
|
||||
public string Path { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the path segments.
|
||||
/// </summary>
|
||||
public string[] PathSegments { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the method.
|
||||
/// </summary>
|
||||
@@ -120,6 +125,7 @@ namespace WireMock
|
||||
Port = url.Port;
|
||||
Origin = $"{url.Scheme}://{url.Host}:{url.Port}";
|
||||
Path = WebUtility.UrlDecode(url.AbsolutePath);
|
||||
PathSegments = Path.Split('/').Skip(1).ToArray();
|
||||
Method = method.ToLower();
|
||||
ClientIP = clientIP;
|
||||
|
||||
@@ -157,11 +163,14 @@ namespace WireMock
|
||||
Port = url.Port;
|
||||
Origin = $"{url.Scheme}://{url.Host}:{url.Port}";
|
||||
Path = WebUtility.UrlDecode(url.AbsolutePath);
|
||||
PathSegments = Path.Split('/').Skip(1).ToArray();
|
||||
Method = method.ToLower();
|
||||
ClientIP = clientIP;
|
||||
|
||||
BodyAsBytes = bodyAsBytes;
|
||||
Body = body;
|
||||
BodyEncoding = bodyEncoding;
|
||||
|
||||
Headers = headers?.ToDictionary(header => header.Key, header => new WireMockList<string>(header.Value));
|
||||
Cookies = cookies;
|
||||
RawQuery = WebUtility.UrlDecode(url.Query);
|
||||
|
||||
Reference in New Issue
Block a user