mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-04-22 06:22:50 +08:00
修改查找ocelot配置文件正则表达式中的问题 (#410)
正则表达式"(?i)ocelot.([a-zA-Z0-9]*).json",“ocelot.”中的“.”能匹配除"\n"外的任意字符;".json"原因是匹配json文件,但实际能匹配任何"*.json*"文件
This commit is contained in:
parent
8e1a5ce827
commit
347303ee7b
@ -30,7 +30,7 @@ namespace Ocelot.DependencyInjection
|
|||||||
|
|
||||||
public static IConfigurationBuilder AddOcelot(this IConfigurationBuilder builder)
|
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);
|
var reg = new Regex(pattern);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user