Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.x] Fix CORS annotation handling error in certain cases #5102

Merged
merged 1 commit into from
Oct 5, 2022

Conversation

tjquinno
Copy link
Member

@tjquinno tjquinno commented Oct 5, 2022

Resolves #5094

Previously the CORS extension used a ProcessAnnotatedType observer tuned to @CrossOrigin to record the AnnotatedType instances with that annotation.

Then, later, a ProcessManagedBean observer would check to see if the AnnotatedType associated with the bean had been recorded earlier. If not, that observer would skip processing the bean.

But, if some extension had altered the AnnotatedType then the specific AnnotatedType instance passed to the PMB observer would not match the instance passed to the PAT observer (and recorded in the CORS extension's data structure). So the PMB logic would incorrectly skip the altered bean.

This PR removes the data structure and the PAT observer entirely. The extension now simply traverses each method of each managed bean, checking for the @CrossOrigin annotation and, if present, processing it.

Signed-off-by: tim.quinn@oracle.com tim.quinn@oracle.com

Signed-off-by: tim.quinn@oracle.com <tim.quinn@oracle.com>
@tjquinno tjquinno added this to the 2.5.4 milestone Oct 5, 2022
@tjquinno tjquinno self-assigned this Oct 5, 2022
@tjquinno tjquinno changed the title Fix CORS annotation handling error in certain cases [2.x] Fix CORS annotation handling error in certain cases Oct 5, 2022
@tjquinno tjquinno merged commit 04c37ec into helidon-io:helidon-2.x Oct 5, 2022
@tjquinno tjquinno deleted the cors-ignored-2.x branch October 5, 2022 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants