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);