-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add Brave-P3A-Version
header support, ignore requests with older client revision
#92
Conversation
62a77bd
to
6f7e18e
Compare
channel, | ||
value | ||
.parse::<usize>() | ||
.expect("minimum channel revision should be non-negative integer"), |
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.
reported by reviewdog 🐶
[semgrep] expect
or unwrap
called in function returning a Result
Source: https://semgrep.dev/r/trailofbits.rs.panic-in-function-returning-result.panic-in-function-returning-result
Cc @thypon @bcaller
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.
This use is ok. Input is controlled by an environment variable in the launch environment and so under the control of the deployer; outside input cannot trigger a panic here. The check is in startup code, so failing quickly on mis-configuration is appropriate.
channel, | ||
value | ||
.parse::<usize>() | ||
.expect("minimum channel revision should be non-negative integer"), |
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.
This use is ok. Input is controlled by an environment variable in the launch environment and so under the control of the deployer; outside input cannot trigger a panic here. The check is in startup code, so failing quickly on mis-configuration is appropriate.
v.to_str() | ||
.unwrap_or_default() | ||
.parse::<usize>() | ||
.unwrap_or_default() |
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.
Just to confirm, this means requests without the revision header will be treated as if they sent Brave-Constellation-Rev: 0
so we're not necessarily excluding all currently-deployed clients?
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.
correct
6f7e18e
to
45a31a4
Compare
Brave-Constellation-Rev
header support, ignore requests with older client revisionBrave-P3A-Revision
header support, ignore requests with older client revision
45a31a4
to
2b62b0a
Compare
2b62b0a
to
cc1cf8f
Compare
Brave-P3A-Revision
header support, ignore requests with older client revisionBrave-P3A-Version
header support, ignore requests with older client revision
No description provided.