File tree Expand file tree Collapse file tree 5 files changed +60
-5
lines changed
fixtures/packages/integrity Expand file tree Collapse file tree 5 files changed +60
-5
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 : true ,
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 1+ Feature : Integrity header
2+
3+ Scenario : Integrity headers are set when setPayloadChecksums is true
4+ Given I navigate to the test URL "/docs/integrity"
5+ And I wait to receive a sampling request
6+ Then I click the element "send-span"
7+ And I wait for 1 span
8+
9+ Then the sampling request "bugsnag-integrity" header matches the regex "^sha1 (\d |[abcdef]){40}$"
10+ Then the trace "bugsnag-integrity" header matches the regex "^sha1 (\d |[abcdef]){40}$"
Original file line number Diff line number Diff line change @@ -16,11 +16,7 @@ def get_test_url()
1616 maze_address = "#{ host } :9339"
1717 end
1818
19- if Maze . config . https
20- protocol = 'https'
21- else
22- protocol = 'http'
23- end
19+ protocol = Maze . config . https ? 'https' : 'http'
2420
2521 UrlGenerator . new (
2622 URI ( "#{ protocol } ://#{ maze_address } " ) ,
You can’t perform that action at this time.
0 commit comments