Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add StringSyntaxAttribute to RequestUri-extension #116

Merged
merged 1 commit into from
Sep 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading