diff --git a/src/MockHttp/Http/DataEscapingHelper.cs b/src/MockHttp/Http/DataEscapingHelper.cs index 4feeb518..3a11165b 100644 --- a/src/MockHttp/Http/DataEscapingHelper.cs +++ b/src/MockHttp/Http/DataEscapingHelper.cs @@ -50,8 +50,9 @@ internal static IEnumerable>> Parse(str private static string UnescapeData(string v) { + // ReSharper disable once ConditionalAccessQualifierIsNonNullableAccordingToAPIContract return Uri.UnescapeDataString(v?.Replace("+", "%20" -#if NET7_0_OR_GREATER || NETSTANDARD2_1 +#if NET6_0_OR_GREATER || NETSTANDARD2_1 , StringComparison.Ordinal #endif )!); diff --git a/src/MockHttp/Matchers/HttpHeadersMatcher.cs b/src/MockHttp/Matchers/HttpHeadersMatcher.cs index 058a227f..c4ddb85b 100644 --- a/src/MockHttp/Matchers/HttpHeadersMatcher.cs +++ b/src/MockHttp/Matchers/HttpHeadersMatcher.cs @@ -111,7 +111,13 @@ public override string ToString() { string value = Value.ToString(); #if !NET6_0_OR_GREATER - value = value.Replace("\r\n", Environment.NewLine); + value = value.Replace( + "\r\n", + Environment.NewLine +#if NETSTANDARD2_1 + , StringComparison.OrdinalIgnoreCase +#endif + ); #endif return $"Headers: {value.TrimEnd('\r', '\n')}";