@@ -1272,28 +1272,26 @@ Dash <- R6::R6Class(
1272
1272
self $ server $ on(' request' , function (server , request , ... ) {
1273
1273
timing_information <- self $ server $ get_data(' timing-information' )
1274
1274
dash_total <- timing_information [[' __dash_server' ]]
1275
- dash_total [[' dur' ]] <- round(as.numeric(Sys.time() - dash_total [[' dur' ]]) * 1000 )
1275
+ timing_information [[ ' __dash_server ' ]] [[' dur' ]] <- round(as.numeric(Sys.time() - dash_total [[' dur' ]]) * 1000 )
1276
1276
1277
- request $ response $ append_header(' Server-Timing' ,
1278
- paste0(' dash_total;dur=' , dash_total [[' dur' ]]))
1279
-
1280
- # ensure dash_server is not returned within the header
1281
- timing_information <- timing_information [names(timing_information ) != " __dash_server" ]
1277
+ header_as_string <- list ()
1282
1278
1283
1279
for (item in seq_along(timing_information )) {
1284
- header_content <- paste0( names(timing_information [item ]), ' ; ' )
1280
+ header_content <- names(timing_information [item ])
1285
1281
1286
1282
if (! is.null(timing_information [[item ]]$ desc )) {
1287
- header_content <- paste0(header_content , ' desc="' , timing_information [[item ]]$ desc , ' "' )
1283
+ header_content <- paste0(header_content , ' ; desc="' , timing_information [[item ]]$ desc , ' "' )
1288
1284
}
1289
1285
1290
1286
if (! is.null(timing_information [[item ]]$ dur )) {
1291
1287
header_content <- paste0(header_content , ' ;dur=' , timing_information [[item ]]$ dur )
1292
1288
}
1293
1289
1294
- request $ response $ append_header(' Server-Timing' ,
1295
- header_content )
1290
+ header_as_string [[item ]] <- header_content
1296
1291
}
1292
+
1293
+ request $ response $ append_header(' Server-Timing' ,
1294
+ paste0(unlist(header_as_string ), collapse = " , " ))
1297
1295
})
1298
1296
}
1299
1297
0 commit comments