-
Notifications
You must be signed in to change notification settings - Fork 2k
Issue #12806 - Overhaul ComplianceViolation.Listener reporting #14090
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
base: jetty-12.1.x
Are you sure you want to change the base?
Changes from all commits
d844e32
1aebe8e
5e95ef7
f2b696a
77e98fc
e6f7d02
640a2e4
9a65251
1f26bbc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,7 @@ | |
| import java.util.List; | ||
| import java.util.ListIterator; | ||
| import java.util.Map; | ||
| import java.util.Objects; | ||
|
|
||
| import org.eclipse.jetty.util.StringUtil; | ||
|
|
||
|
|
@@ -85,6 +86,8 @@ public List<HttpCookie> getCookies(HttpFields headers) | |
|
|
||
| public List<HttpCookie> getCookies(HttpFields headers, ComplianceViolation.Listener complianceViolationListener) | ||
| { | ||
| Objects.requireNonNull(complianceViolationListener); | ||
|
|
||
| boolean building = false; | ||
| ListIterator<String> raw = _rawFields.listIterator(); | ||
| // For each of the headers | ||
|
|
@@ -164,7 +167,9 @@ public List<HttpCookie> getCookies(HttpFields headers, ComplianceViolation.Liste | |
| } | ||
|
|
||
| if (_violations != null && !_violations.isEmpty()) | ||
| { | ||
| _violations.forEach(complianceViolationListener::onComplianceViolation); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we assertNotNull on the cVL? or skip this line if it is null?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The expectation is that there will always be a cVL, even if its just |
||
| } | ||
|
|
||
| return _cookieList == null ? Collections.emptyList() : _cookieList; | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is more natural to report violations to the HttpConfiguration rather than the HttpChannel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But that's the wrong place and doesn't take into account the cVL.initialize() / cVL.onRequestBegin() / cVL.onRequestEnd() requirements.
The HttpChannel is also the place where these events fire.
The individual violations (cVL.onComplianceViolation()) occur between these.