CorsMiddleware don’t use the CorsConfigurer
nguereza-tony opened this issue · 1 comments
nguereza-tony commented
Is your feature request related to a problem? Please describe.**
In the class CorsMiddleware the overwrite method « handle() » use the default values of cors policies instead of the CorsConfigurer.
Describe the solution you'd like
Change method to :
@OverRide
public void handle(RouteContext context) {
this. allowHeads(context)
. allowMethods(context)
. allowCredentials(context)
. setMaxAge(context);
context.status(204);
}
Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
hellokaton commented
Make CORS configuration easy in 2.1.x
version, as shown in the following code.
CorsOptions corsOptions = CorsOptions.forAnyOrigin().allowNullOrigin().allowCredentials();
Blade.of()
.cors(corsOptions)
.listen().start(Application.class);