From 626ed7dbef928bc7787ca1ad09923ff66607e3d8 Mon Sep 17 00:00:00 2001 From: Luis Majano Date: Mon, 22 Apr 2024 11:32:31 +0200 Subject: [PATCH] more compats on engine detection --- system/BaseSpec.cfc | 2 ++ system/reports/BaseReporter.cfc | 6 +++--- system/util/Util.cfc | 6 +++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/system/BaseSpec.cfc b/system/BaseSpec.cfc index c479c8b..e538489 100644 --- a/system/BaseSpec.cfc +++ b/system/BaseSpec.cfc @@ -870,8 +870,10 @@ component { string labels = "" ) output=true{ setting requesttimeout=99999999; + // content type defaulted, to avoid dreaded wddx default getPageContext().getResponse().setContentType( "text/html" ); + // run tests var runner = new testbox.system.TestBox( bundles : "#getMetadata( this ).name#", diff --git a/system/reports/BaseReporter.cfc b/system/reports/BaseReporter.cfc index 40d2560..defe700 100644 --- a/system/reports/BaseReporter.cfc +++ b/system/reports/BaseReporter.cfc @@ -17,10 +17,10 @@ component { * Helper method to deal with ACF2016's overload of the page context response, come on Adobe, get your act together! */ function getPageContextResponse(){ - if ( structKeyExists( server, "lucee" ) ) { - return getPageContext().getResponse(); - } else { + if( server.keyExists( "coldfusion" ) && server.coldfusion.productName.findNoCase( "ColdFusion") ){ return getPageContext().getResponse().getResponse(); + } else { + return getPageContext().getResponse(); } } diff --git a/system/util/Util.cfc b/system/util/Util.cfc index 50be0e0..71c3395 100644 --- a/system/util/Util.cfc +++ b/system/util/Util.cfc @@ -108,10 +108,10 @@ component { * Check if you are in cfthread or not for any CFML Engine */ boolean function inThread(){ - var engine = "ADOBE"; + var engine = "LUCEE"; - if ( server.coldfusion.productname eq "Lucee" ) { - engine = "LUCEE"; + if ( server.keyExists( "coldfusion" ) && server.coldfusion.productname.findNoCase( "ColdFusion") ) { + engine = "ADOBE"; } switch ( engine ) {