From f5a0db25a7abda6360b51064733fc08a36d3ee78 Mon Sep 17 00:00:00 2001 From: skwasjer <11424653+skwasjer@users.noreply.github.com> Date: Tue, 10 Sep 2024 08:12:35 +0200 Subject: [PATCH] feat: add StringSyntaxAttribute to RequestUri-extension --- src/MockHttp/Extensions/RequestMatchingExtensions.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/MockHttp/Extensions/RequestMatchingExtensions.cs b/src/MockHttp/Extensions/RequestMatchingExtensions.cs index 41bf02e2..d2b9106a 100644 --- a/src/MockHttp/Extensions/RequestMatchingExtensions.cs +++ b/src/MockHttp/Extensions/RequestMatchingExtensions.cs @@ -1,5 +1,6 @@ using System.Collections.Specialized; using System.ComponentModel; +using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq.Expressions; using System.Net.Http.Headers; @@ -37,7 +38,13 @@ private static bool ContainsWildcard(this string value) /// The request URI or a URI wildcard. /// The request matching builder instance. #pragma warning disable CA1054 - public static RequestMatching RequestUri(this RequestMatching builder, string requestUri) + public static RequestMatching RequestUri( + this RequestMatching builder, +#if NET8_0_OR_GREATER + [StringSyntax(StringSyntaxAttribute.Uri)] +#endif + string requestUri + ) #pragma warning restore CA1054 { return builder.RequestUri(requestUri, true);