在动态路由模式下,使用上游报头匹配路由会引发奇怪的 `Regex` 异常
sec-ch-ua "Microsoft Edge";v="143", "Chromium";v="143", "Not A(Brand";v="24" 失败: Ocelot.Errors.Middleware.ExceptionHandlerMiddleware[0] RequestId: 0HNIHMRHATJS9:00000003, PreviousRequestId: - 在全局错误处理器中捕获了 RegexParseException! 已完成对原始 RegexParseException 下面的请求 0HNIHMRHATJS9:00000003 的 0 个内部异常的报告 -> System.Text.RegularExpressions.RegexParseException: 无效模式 '^(?i)"Microsoft Edge";v="143", "Chromium";v="143", "Not A(Brand";v="24"$' 在偏移 72 处。不足 )'。 at System.Text.RegularExpressions.RegexParser.ScanRegex() at System.Text.RegularExpressions.RegexParser.Parse(String pattern, RegexOptions options, CultureInfo culture) at System.Text.RegularExpressions.Regex..ctor(String pattern, RegexOptions options, TimeSpan matchTimeout, CultureInfo culture) at System.Text.RegularExpressions.Regex..ctor(String pattern, RegexOptions options, TimeSpan matchTimeout) at Ocelot.Infrastructure.RegexGlobal.New(String pattern, RegexOptions options) at Ocelot.Values.UpstreamHeaderTemplate..ctor(String template, String originalValue) at Ocelot.Configuration.Creator.UpstreamHeaderTemplatePatternCreator.Create(IDictionary`2 upstreamHeaderTemplates, Boolean routeIsCaseSensitive) at Ocelot.DownstreamRouteFinder.Finder.DiscoveryDownstreamRouteFinder.Get(String upstreamUrlPath, String upstreamQueryString, String upstreamHttpMethod, IInternalConfiguration configuration, String upstreamHost, IDictionary`2 upstreamHeaders) at Ocelot.DownstreamRouteFinder.Middleware.DownstreamRouteFinderMiddleware.Invoke(HttpContext httpContext) at Ocelot.Responder.Middleware.ResponderMiddleware.Invoke(HttpContext context) at Ocelot.Errors.Middleware.ExceptionHandlerMiddleware.Invoke(HttpContext context)
内容来源: ThreeMammals/Ocelot