@@ -48,6 +48,7 @@ const LLMO_SHEETDATA_SOURCE_URL = 'https://main--project-elmo-ui-data--adobe.aem
4848
4949function LlmoController ( ctx ) {
5050 const accessControlUtil = AccessControlUtil . fromContext ( ctx ) ;
51+
5152 // Helper function to get site and validate LLMO config
5253 const getSiteAndValidateLlmo = async ( context ) => {
5354 const { siteId } = context . params ;
@@ -140,7 +141,7 @@ function LlmoController(ctx) {
140141 headers : {
141142 Authorization : `token ${ env . LLMO_HLX_API_KEY || 'hlx_api_key_missing' } ` ,
142143 'User-Agent' : SPACECAT_USER_AGENT ,
143- 'Accept-Encoding' : 'gzip ' ,
144+ 'Accept-Encoding' : 'br ' ,
144145 } ,
145146 } ) ;
146147
@@ -152,7 +153,7 @@ function LlmoController(ctx) {
152153 // Get the response data
153154 const data = await response . json ( ) ;
154155
155- // Return the data and let the framework handle the compression
156+ // Return the data, pass through any compression headers from upstream
156157 return ok ( data , {
157158 ...( response . headers ? Object . fromEntries ( response . headers . entries ( ) ) : { } ) ,
158159 } ) ;
@@ -236,7 +237,7 @@ function LlmoController(ctx) {
236237 headers : {
237238 Authorization : `token ${ env . LLMO_HLX_API_KEY || 'hlx_api_key_missing' } ` ,
238239 'User-Agent' : SPACECAT_USER_AGENT ,
239- 'Accept-Encoding' : 'gzip ' ,
240+ 'Accept-Encoding' : 'br ' ,
240241 } ,
241242 } ) ;
242243
@@ -318,7 +319,7 @@ function LlmoController(ctx) {
318319 const totalDuration = methodEndTime - methodStartTime ;
319320 log . info ( `LLMO query completed - total duration: ${ totalDuration } ms (fetch: ${ fetchDuration } ms, inclusion: ${ inclusionDuration } ms, filtering: ${ filterDuration } ms, exclusion: ${ exclusionDuration } ms, grouping: ${ groupingDuration } ms, mapping: ${ mappingDuration } ms)` ) ;
320321
321- // Return the data and let the framework handle the compression
322+ // Return the data, pass through any compression headers from upstream
322323 return ok ( data , {
323324 ...( response . headers ? Object . fromEntries ( response . headers . entries ( ) ) : { } ) ,
324325 } ) ;
@@ -361,7 +362,7 @@ function LlmoController(ctx) {
361362 headers : {
362363 Authorization : `token ${ env . LLMO_HLX_API_KEY || 'hlx_api_key_missing' } ` ,
363364 'User-Agent' : SPACECAT_USER_AGENT ,
364- 'Accept-Encoding' : 'gzip ' ,
365+ 'Accept-Encoding' : 'br ' ,
365366 } ,
366367 } ) ;
367368
0 commit comments