File tree 1 file changed +4
-4
lines changed
packages/gatsby-plugin-benchmark-reporting/src
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -249,17 +249,17 @@ class BenchMeta {
249
249
method : `POST` ,
250
250
headers : {
251
251
"content-type" : `application/json` ,
252
- // "user-agent ": this.getUserAgent() ,
252
+ "x-benchmark-secret " : process . env . BENCHMARK_REPORTING_SECRET ,
253
253
} ,
254
254
body : json ,
255
255
} ) . then ( res => {
256
256
lastStatus = res . status
257
- if ( lastStatus === 500 ) {
258
- reportInfo ( `Got 500 response, waiting for text` )
257
+ if ( [ 401 , 500 ] . includes ( lastStatus ) ) {
258
+ reportInfo ( `Got ${ lastStatus } response, waiting for text` )
259
259
res . text ( ) . then ( content => {
260
260
reportError (
261
261
`Response error` ,
262
- new Error ( `Server responded with a 500 error: ${ content } ` )
262
+ new Error ( `Server responded with a ${ lastStatus } error: ${ content } ` )
263
263
)
264
264
process . exit ( 1 )
265
265
} )
You can’t perform that action at this time.
0 commit comments