@@ -97,7 +97,7 @@ class CloudflareAdapter {
97
97
this . eventListenersResult = await this . eventListeners . trigger (
98
98
'beforeProcessingRequest' ,
99
99
request ,
100
- this . coreLogic . requestConfig ,
100
+ this . coreLogic . requestConfig
101
101
) ;
102
102
if ( this . eventListenersResult && this . eventListenersResult . modifiedRequest ) {
103
103
preRequest = this . eventListenersResult . modifiedRequest ;
@@ -114,7 +114,7 @@ class CloudflareAdapter {
114
114
request ,
115
115
result . reqResponse ,
116
116
this . coreLogic . requestConfig ,
117
- result ,
117
+ result
118
118
) ;
119
119
let postResponse = result . reqResponse ;
120
120
if ( this . eventListenersResult && this . eventListenersResult . modifiedResponse ) {
@@ -128,7 +128,7 @@ class CloudflareAdapter {
128
128
'beforeResponse' ,
129
129
request ,
130
130
result . reqResponse ,
131
- result ,
131
+ result
132
132
) ;
133
133
}
134
134
@@ -148,7 +148,7 @@ class CloudflareAdapter {
148
148
'afterResponse' ,
149
149
request ,
150
150
result . reqResponse ,
151
- result ,
151
+ result
152
152
) ;
153
153
fetchResponse = this . eventListenersResult . modifiedResponse || result . reqResponse ;
154
154
return fetchResponse ;
@@ -158,7 +158,7 @@ class CloudflareAdapter {
158
158
if ( httpMethod === 'GET' && ( this . coreLogic . datafileOperation || this . coreLogic . configOperation ) ) {
159
159
const fileType = this . coreLogic . datafileOperation ? 'datafile' : 'config file' ;
160
160
this . logger . debug (
161
- `GET request detected. Returning current ${ fileType } for SDK Key: ${ this . coreLogic . sdkKey } [fetchHandler]` ,
161
+ `GET request detected. Returning current ${ fileType } for SDK Key: ${ this . coreLogic . sdkKey } [fetchHandler]`
162
162
) ;
163
163
return result . reqResponse ;
164
164
}
@@ -169,7 +169,7 @@ class CloudflareAdapter {
169
169
fetchResponse = await this . fetchAndProcessRequest ( request , originUrl , cdnSettings , ctx ) ;
170
170
} else {
171
171
this . logger . debug (
172
- 'No CDN settings found or CDN Response URL is undefined. Fetching directly from origin without caching.' ,
172
+ 'No CDN settings found or CDN Response URL is undefined. Fetching directly from origin without caching.'
173
173
) ;
174
174
fetchResponse = await this . fetchFromOriginOrCDN ( request ) ;
175
175
}
@@ -187,7 +187,7 @@ class CloudflareAdapter {
187
187
setFetchAndProcessLogs ( validCDNSettings , cdnSettings ) {
188
188
if ( ! validCDNSettings ) {
189
189
this . logger . debug (
190
- 'No CDN settings found or CDN Response URL is undefined. Fetching directly from origin without caching [fetchHandler]' ,
190
+ 'No CDN settings found or CDN Response URL is undefined. Fetching directly from origin without caching [fetchHandler]'
191
191
) ;
192
192
} else {
193
193
}
@@ -196,7 +196,7 @@ class CloudflareAdapter {
196
196
this . logger . debug (
197
197
`Fetching content from origin in CDN Adapter [fetchHandler -> fetchAndProcessRequest] - ` ,
198
198
`shouldCacheResponse is ${ this . shouldCacheResponse } and validCDNSettings is ${ validCDNSettings } and ` ,
199
- `cdnSettings.forwardRequestToOrigin is ${ cdnSettings . forwardRequestToOrigin } ` ,
199
+ `cdnSettings.forwardRequestToOrigin is ${ cdnSettings . forwardRequestToOrigin } `
200
200
) ;
201
201
}
202
202
}
@@ -230,7 +230,7 @@ class CloudflareAdapter {
230
230
'beforeRequest' ,
231
231
newRequest ,
232
232
this . reqResponse ,
233
- this . result ,
233
+ this . result
234
234
) ;
235
235
if ( this . eventListenersResult && this . eventListenersResult . modifiedRequest ) {
236
236
newRequest = this . eventListenersResult . modifiedRequest ;
@@ -309,7 +309,7 @@ class CloudflareAdapter {
309
309
'beforeReadingCache' ,
310
310
request ,
311
311
this . requestConfig ,
312
- this . result ,
312
+ this . result
313
313
) ;
314
314
if ( ! this . coreLogic . requestConfig . overrideCache ) {
315
315
response = await cache . match ( cacheKey ) ;
@@ -319,7 +319,7 @@ class CloudflareAdapter {
319
319
request ,
320
320
response ,
321
321
this . requestConfig ,
322
- this . result ,
322
+ this . result
323
323
) ;
324
324
if ( this . eventListenersResult && this . eventListenersResult . modifiedResponse ) {
325
325
response = this . eventListenersResult . modifiedResponse ;
@@ -339,7 +339,7 @@ class CloudflareAdapter {
339
339
'afterCacheResponse' ,
340
340
request ,
341
341
response ,
342
- this . result ,
342
+ this . result
343
343
) ;
344
344
if ( this . eventListenersResult && this . eventListenersResult . modifiedResponse ) {
345
345
response = this . eventListenersResult . modifiedResponse ;
@@ -448,7 +448,7 @@ class CloudflareAdapter {
448
448
'beforeCacheResponse' ,
449
449
this . request ,
450
450
responseToCache ,
451
- this . result ,
451
+ this . result
452
452
) ;
453
453
if ( this . eventListenersResult && this . eventListenersResult . modifiedResponse ) {
454
454
response = this . eventListenersResult . modifiedResponse ;
@@ -483,7 +483,7 @@ class CloudflareAdapter {
483
483
ctx . waitUntil (
484
484
this . dispatchAllEventsToOptimizely ( defaultSettings . optimizelyEventsEndpoint , allEvents ) . catch ( ( err ) => {
485
485
this . logger . error ( 'Failed to dispatch event:' , err ) ;
486
- } ) ,
486
+ } )
487
487
) ;
488
488
} catch ( error ) {
489
489
this . logger . error ( 'Error during event consolidation or dispatch:' , error ) ;
@@ -538,7 +538,7 @@ class CloudflareAdapter {
538
538
{
539
539
status : 500 ,
540
540
statusText : 'Internal Server Error' ,
541
- } ,
541
+ }
542
542
) ;
543
543
}
544
544
}
@@ -674,15 +674,15 @@ class CloudflareAdapter {
674
674
const response = await this . fetchFromOriginOrCDN ( eventRequest ) ;
675
675
const operationResult = ! ! response . ok ;
676
676
this . logger . debug (
677
- `Events were dispatched to Optimizely [dispatchAllEventsToOptimizely] - Operation Result: ${ operationResult } ` ,
677
+ `Events were dispatched to Optimizely [dispatchAllEventsToOptimizely] - Operation Result: ${ operationResult } `
678
678
) ;
679
679
680
680
this . eventListenersResult = this . eventListeners . trigger (
681
681
'afterDispatchingEvents' ,
682
682
eventRequest ,
683
683
response ,
684
684
modifiedEvents ,
685
- operationResult ,
685
+ operationResult
686
686
) ;
687
687
688
688
if ( ! operationResult ) {
@@ -1156,15 +1156,15 @@ class CloudflareAdapter {
1156
1156
setMultipleResponseHeaders ( response , headers ) {
1157
1157
this . logger . debugExt ( `Setting multiple headers [setMultipleResponseHeaders]:` , headers ) ;
1158
1158
// Clone the original response
1159
- const newResponse = this . cloneResponse ( response ) ;
1159
+ // const newResponse = this.cloneResponse(response);
1160
1160
// const newResponse = response;
1161
1161
1162
1162
// Update the headers with new values
1163
1163
Object . entries ( headers ) . forEach ( ( [ name , value ] ) => {
1164
- this . abstractionHelper . abstractResponse . setHeaderInResponse ( newResponse , name , value ) ;
1164
+ this . abstractionHelper . abstractResponse . setHeaderInResponse ( response , name , value ) ;
1165
1165
} ) ;
1166
1166
this . logger . debug ( `Headers set in response [setMultipleResponseHeaders]` ) ;
1167
- return newResponse ;
1167
+ return response ;
1168
1168
}
1169
1169
1170
1170
/**
0 commit comments