Skip to content

Commit

Permalink
feat: add StringSyntaxAttribute to RequestUri-extension (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
skwasjer authored Sep 17, 2024
1 parent eaa8ebb commit a5e42b6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/MockHttp/Extensions/RequestMatchingExtensions.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -37,7 +38,13 @@ private static bool ContainsWildcard(this string value)
/// <param name="requestUri">The request URI or a URI wildcard.</param>
/// <returns>The request matching builder instance.</returns>
#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);
Expand Down

0 comments on commit a5e42b6

Please sign in to comment.