类 UrlBasedCorsConfigurationSource
java.lang.Object
cn.taketoday.web.cors.UrlBasedCorsConfigurationSource
- 所有已实现的接口:
CorsConfigurationSource
Provide a per request
CorsConfiguration instance based on a
collection of CorsConfiguration mapped on path patterns.
Exact path mapping URIs (such as "/admin") are supported
as well as Ant-style path patterns (such as "/admin/**").
- 从以下版本开始:
- 3.0
- 作者:
- Sebastien Deleuze, TODAY 2020/12/10 23:09
-
字段概要
字段 -
构造器概要
构造器构造器说明Default constructor withPathPatternParser.defaultInstance.Constructor with aPathPatternParserto parse patterns with. -
方法概要
修饰符和类型方法说明getCorsConfiguration(RequestContext request) Return aCorsConfigurationbased on the incoming request.Get the CORS configuration.voidregisterCorsConfiguration(String pattern, CorsConfiguration config) Variant ofsetCorsConfigurations(Map)to register one mapping at a time.voidsetCorsConfigurations(Map<String, CorsConfiguration> corsConfigurations) Set the CORS configuration mappings.
-
字段详细资料
-
corsConfigurations
-
patternParser
-
-
构造器详细资料
-
UrlBasedCorsConfigurationSource
public UrlBasedCorsConfigurationSource()Default constructor withPathPatternParser.defaultInstance. -
UrlBasedCorsConfigurationSource
Constructor with aPathPatternParserto parse patterns with.- 参数:
parser- the parser to use- 从以下版本开始:
- 4.0
-
-
方法详细资料
-
setCorsConfigurations
Set the CORS configuration mappings.For pattern syntax see
AntPathMatcherandPathPatternas well as class-level Javadoc for details on which one may in use. Generally the syntax is largely the same withPathPatternmore tailored for web usage.- 参数:
corsConfigurations- the mappings to use- 另请参阅:
-
PathPatternAntPathMatcher
-
registerCorsConfiguration
Variant ofsetCorsConfigurations(Map)to register one mapping at a time.- 参数:
pattern- the mapping patternconfig- the CORS configuration to use for the pattern- 另请参阅:
-
PathPatternAntPathMatcher
-
getCorsConfigurations
Get the CORS configuration. -
getCorsConfiguration
从接口复制的说明:CorsConfigurationSourceReturn aCorsConfigurationbased on the incoming request.- 指定者:
getCorsConfiguration在接口中CorsConfigurationSource- 返回:
- the associated
CorsConfiguration, ornullif none
-