File tree Expand file tree Collapse file tree 4 files changed +58
-0
lines changed
fixtures/packages/integrity-disabled Expand file tree Collapse file tree 4 files changed +58
-0
lines changed Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html >
3+ < head >
4+ < meta charset ="utf-8 " />
5+ < link href ="/favicon.png " rel ="shortcut icon " type ="image/x-icon ">
6+ < script src ="./dist/bundle.js " type ="module "> </ script >
7+ < title > Integrity header</ title >
8+ </ head >
9+ < body >
10+ < h1 > integrity-header</ h1 >
11+ < button id ="send-span "> send-span</ button >
12+ </ body >
13+ </ html >
Original file line number Diff line number Diff line change 1+ {
2+ "name" : " integrity" ,
3+ "private" : true ,
4+ "scripts" : {
5+ "build" : " rollup --config ../rollup.config.mjs" ,
6+ "clean" : " rm -rf dist"
7+ }
8+ }
Original file line number Diff line number Diff line change 1+ import BugsnagPerformance from '@bugsnag/browser-performance'
2+
3+ const parameters = new URLSearchParams ( window . location . search )
4+ const apiKey = parameters . get ( 'api_key' )
5+ const endpoint = parameters . get ( 'endpoint' )
6+
7+ BugsnagPerformance . start ( {
8+ apiKey,
9+ endpoint,
10+ sendPayloadChecksums : false ,
11+ maximumBatchSize : 1 ,
12+ autoInstrumentFullPageLoads : false ,
13+ autoInstrumentNetworkRequests : false ,
14+ autoInstrumentRouteChanges : false ,
15+ serviceName : 'integrity'
16+ } )
17+
18+ document . getElementById ( 'send-span' ) . onclick = ( ) => {
19+ const spanOptions = { }
20+
21+ if ( parameters . has ( 'isFirstClass' ) ) {
22+ spanOptions . isFirstClass = JSON . parse ( parameters . get ( 'isFirstClass' ) )
23+ }
24+
25+ const span = BugsnagPerformance . startSpan ( "Custom/ManualSpanScenario" , spanOptions )
26+ span . end ( )
27+ }
28+
Original file line number Diff line number Diff line change @@ -8,3 +8,12 @@ Scenario: Integrity headers are set when setPayloadChecksums is true
88
99 Then the sampling request "bugsnag-integrity" header matches the regex "^sha1 (\d |[abcdef]){40}$"
1010 Then the trace "bugsnag-integrity" header matches the regex "^sha1 (\d |[abcdef]){40}$"
11+
12+ Scenario : Integrity headers are not set when setPayloadChecksums is false
13+ Given I navigate to the test URL "/docs/integrity-disabled"
14+ And I wait to receive a sampling request
15+ Then I click the element "send-span"
16+ And I wait for 1 span
17+
18+ Then the sampling request "bugsnag-integrity" header is not present
19+ Then the trace "bugsnag-integrity" header is not present
You can’t perform that action at this time.
0 commit comments