Skip to content

Support @CrossOrigin as a merged composed annotation [SPR-13468] #18047

Closed
@spring-projects-issues

Description

@spring-projects-issues

Nicolas Labrot opened SPR-13468 and commented

Given this composed annotation:

@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@RequestMapping
@CrossOrigin
@ResponseBody
public @interface CorsRequestMapping {
    String[] path() default {};
    String[] origins() default {};
    RequestMethod[] method() default {};
}

The resulting @CrossOrigin "origins" attribute is not merged. Issue seems to come from RequestMappingHandlerMapping#initCorsConfiguration which does not use AnnotatedElementUtils.findMergedAnnotation(*, CrossOrigin.class);.


Affects: 4.2 GA

Issue Links:

Referenced from: commits e4c0859, 0ad59dd

0 votes, 5 watchers

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions