mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-03-30 13:51:48 +02:00
Use default timeout for Regex (#1160)
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
#if NET451 || NET452 || NET46 || NET451 || NET461 || NETSTANDARD1_3 || NETSTANDARD2_0
|
||||
using System.Text.RegularExpressions;
|
||||
using WireMock.Constants;
|
||||
|
||||
// ReSharper disable once CheckNamespace
|
||||
namespace System;
|
||||
@@ -11,7 +12,7 @@ internal static class StringExtensions
|
||||
public static string Replace(this string text, string oldValue, string newValue, StringComparison stringComparison)
|
||||
{
|
||||
var options = stringComparison == StringComparison.OrdinalIgnoreCase ? RegexOptions.IgnoreCase : RegexOptions.None;
|
||||
return Regex.Replace(text, oldValue, newValue, options);
|
||||
return Regex.Replace(text, oldValue, newValue, options, WireMockConstants.DefaultRegexTimeout);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user