-
Notifications
You must be signed in to change notification settings - Fork 4
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 sendPayloadChecksums config option and implement Bugsnag-Integrit… #532
base: next
Are you sure you want to change the base?
Conversation
// sendPayloadChecksums is false by default unless custom endpoints are not specified | ||
if (typeof config !== 'string' && !config.endpoint) { | ||
configuration.sendPayloadChecksums = ('sendPayloadChecksums' in config && config.sendPayloadChecksums) || true | ||
} |
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.
Not keen on this but not sure of a better way. We need to work out what config options the user passed in to determine the behaviour. const configuration = validateConfig<S, C>(config, options.schema)
does more than just validate, it creates a config with all values set based on the schema, using default values if not supplied.
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.
right now this is the place we're performing similar manipulation on the configuration, perhaps we could refactor the validation to include this, possibly separating out validation and 'cleaning' but I think for now this is fine
Browser bundle sizeNPM build
CDN build
Code coverage
Total:
Generated against 906d8c6 on 29 November 2024 at 17:11:19 UTC |
// sendPayloadChecksums is false by default unless custom endpoints are not specified | ||
if (typeof config !== 'string' && !config.endpoint) { | ||
configuration.sendPayloadChecksums = ('sendPayloadChecksums' in config && config.sendPayloadChecksums) || true | ||
} |
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.
right now this is the place we're performing similar manipulation on the configuration, perhaps we could refactor the validation to include this, possibly separating out validation and 'cleaning' but I think for now this is fine
} | ||
} | ||
|
||
window.isSecureContext = false |
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.
does this remain false
for the next test? we're using beforeAll
rather than beforeEach
to revert this back to true
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.
Ah yeah 👍 fixed
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.
looks good to me - a rebase from next should resolve the ios https tests
Goal
Add Bugsnag-Integrity request header (where required APIs are available) and implement the
sendPayloadChecksums
core config option to allow opting out of this behavior.Bugsnag-Integrity headers are set by default unless the
endpoint
configuration option is set, in which case they are disabled. This behavior can be overriden with the newsendPayloadChecksums
config option.Design
sendPayloadChecksums
was chosen to avoid possible CORS issues where custom endpoints are being used and they are not configured to accept the newBugsnag-Integrity
in requests.Changeset
sendPayloadChecksums
core config optionBugsnag-Integrity
in delivery-fetchTesting