mirror of
				https://github.com/nsnail/Ocelot.git
				synced 2025-11-04 15:30:49 +08:00 
			
		
		
		
	修改查找ocelot配置文件正则表达式中的问题 (#410)
正则表达式"(?i)ocelot.([a-zA-Z0-9]*).json",“ocelot.”中的“.”能匹配除"\n"外的任意字符;".json"原因是匹配json文件,但实际能匹配任何"*.json*"文件
This commit is contained in:
		@@ -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);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user