-
Notifications
You must be signed in to change notification settings - Fork 94
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
chore(csp): Filter out unsupported report types #3295
Conversation
@@ -72,6 +74,21 @@ impl SecurityReportParams { | |||
} | |||
} | |||
|
|||
/// Check if the report type is supported. |
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.
/// Check if the report type is supported. | |
/// Checks if the report type is supported. |
@@ -72,6 +74,21 @@ impl SecurityReportParams { | |||
} | |||
} | |||
|
|||
/// Check if the report type is supported. | |||
/// | |||
/// Note: use only for the reports sent through the Reporting Api. |
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.
/// Note: use only for the reports sent through the Reporting Api. | |
/// Note: use only for the reports sent through the Reporting API. |
Self::create_security_item(&query, Bytes::from(item.to_owned().to_string())); | ||
envelope.add_item(report_item); | ||
let data = Bytes::from(item.to_owned().to_string()); | ||
if is_supported_type(&data) { |
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.
Instead of parsing the data here, couldn't we filter out the unsupported type in the envelope processor (after or during the parsing step)?
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 first thought to do it in processor, but then , I've got an idea to discard those items as earlier as possible and later we won't do extra work. But yeah, I will move this back to processor.
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.
done in a0e3a4a
In case if the default report group defined and used for CSP reports (with Reporting Api), browser also will use that group for sending
deprecation
reports, which we do not support and should filter them out.followup for #3293 #3277
#skip-changelog