File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -42,10 +42,15 @@ const fastify = Fastify({
4242Sentry . setupFastifyErrorHandler ( fastify ) ;
4343await fastify . register ( envPlugin ) ;
4444
45+ let sentryHost = null ;
46+ if ( fastify . config . BFF_SENTRY_DSN && fastify . config . BFF_SENTRY_DSN . length > 0 ) {
47+ sentryHost = new URL ( fastify . config . BFF_SENTRY_DSN ) . hostname ;
48+ }
49+
4550fastify . register ( helmet , {
4651 contentSecurityPolicy : {
4752 directives : {
48- 'connect-src' : [ "'self'" , 'sdk.openui5.org' , 'o1240783.ingest.us.sentry.io' ] ,
53+ 'connect-src' : [ "'self'" , 'sdk.openui5.org' , sentryHost ] ,
4954 'script-src' : isLocalDev ? [ "'self'" , "'unsafe-inline'" ] : [ "'self'" ] ,
5055 'frame-ancestors' : [ fastify . config . FRAME_ANCESTORS ] ,
5156 } ,
Original file line number Diff line number Diff line change @@ -29,6 +29,9 @@ const schema = {
2929 FEEDBACK_SLACK_URL : { type : 'string' } ,
3030 FEEDBACK_URL_LINK : { type : 'string' } ,
3131 FRAME_ANCESTORS : { type : 'string' } ,
32+ BFF_SENTRY_DSN : { type : 'string' } ,
33+ VITE_SENTRY_DSN : { type : 'string' } ,
34+ VITE_ENVIRONMENT : { type : 'string' } ,
3235
3336 // System variables
3437 NODE_ENV : { type : 'string' , enum : [ 'development' , 'production' ] } ,
You can’t perform that action at this time.
0 commit comments