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

Refactor CrossOriginFilter with small perf improvements #4672

Merged
merged 2 commits into from
Mar 16, 2020

Conversation

dennyac
Copy link
Contributor

@dennyac dennyac commented Mar 14, 2020

Hi maintainers,

I've made a small change to split the list of origins into a set of origins (for exact match) and a list of patterns (for pattern match). This way for exact match we can check if the set contains the origin (instead of iterating through the list) and only iterate through the origins for pattern matching.

This change also creates patterns during the init phase, instead of creating a new Pattern object during each request

Functionality remains unchanged. Not sure if any tests need to be added, but do let me know if any specific tests are required.

Force pushed for adding signoff

@dennyac dennyac force-pushed the refactor-cross-origin-filter branch from 99874e7 to 904cd38 Compare March 14, 2020 16:38
Signed-off-by: Denny Abraham Cheriyan <[email protected]>
@dennyac dennyac force-pushed the refactor-cross-origin-filter branch from 904cd38 to 3c4ab14 Compare March 14, 2020 16:41
@dennyac
Copy link
Contributor Author

dennyac commented Mar 15, 2020

Will look into the build issues and resolve it.

Signed-off-by: Denny Abraham Cheriyan <[email protected]>
@dennyac
Copy link
Contributor Author

dennyac commented Mar 16, 2020

Fixed checkstyle violation

Copy link
Contributor

@gregw gregw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!
Ultimately we probably should look to use our IncludeExcludeSet mechanism here, but this is a good improvement within the same semantic.

I think this is also worthwhile in jetty-9.4, so I will merge and then cherry-pick back.

@gregw gregw merged commit fb00422 into jetty:jetty-10.0.x Mar 16, 2020
gregw pushed a commit that referenced this pull request Mar 16, 2020
* Refactor CrossOriginFilter

Signed-off-by: Denny Abraham Cheriyan <[email protected]>

* Fix checkstyle violation

Signed-off-by: Denny Abraham Cheriyan <[email protected]>
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.

2 participants