From 347303ee7b3fb425bc82a0e539b32887cdc36331 Mon Sep 17 00:00:00 2001 From: Ni Yanwei Date: Mon, 18 Jun 2018 02:25:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9F=A5=E6=89=BEocelot?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E6=AD=A3=E5=88=99=E8=A1=A8?= =?UTF-8?q?=E8=BE=BE=E5=BC=8F=E4=B8=AD=E7=9A=84=E9=97=AE=E9=A2=98=20(#410)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 正则表达式"(?i)ocelot.([a-zA-Z0-9]*).json",“ocelot.”中的“.”能匹配除"\n"外的任意字符;".json"原因是匹配json文件,但实际能匹配任何"*.json*"文件 --- .../DependencyInjection/ConfigurationBuilderExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ocelot/DependencyInjection/ConfigurationBuilderExtensions.cs b/src/Ocelot/DependencyInjection/ConfigurationBuilderExtensions.cs index 9e471475..7eb94329 100644 --- a/src/Ocelot/DependencyInjection/ConfigurationBuilderExtensions.cs +++ b/src/Ocelot/DependencyInjection/ConfigurationBuilderExtensions.cs @@ -30,7 +30,7 @@ namespace Ocelot.DependencyInjection public static IConfigurationBuilder AddOcelot(this IConfigurationBuilder builder) { - const string pattern = "(?i)ocelot.([a-zA-Z0-9]*).json"; + const string pattern = "(?i)ocelot\\.([a-zA-Z0-9]*)(\\.json)$"; var reg = new Regex(pattern);