Skip to content

Commit b952b2d

Browse files
committed
only enable debugging option if in development
1 parent c9b4bf6 commit b952b2d

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

test/index.cfm

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
<cfif structKeyExists( url, "debug" )>
2-
<cfscript>
3-
system = createObject( "java", "java.lang.System" );
4-
env = system.getenv();
5-
</cfscript>
1+
2+
<cfscript>
3+
system = createObject( "java", "java.lang.System" );
4+
env = system.getenv();
5+
debugEnabled = structKeyExists( env, "ENVIRONMENT" ) ? ( env.ENVIRONMENT == "development" ) : false;
6+
</cfscript>
7+
<cfif debugEnabled && structKeyExists( url, "debug" )>
68
<cfheader name="Content-Type" value="application/json"/>
79
<cfswitch expression="#url.debug#">
810
<cfcase value="cgi">
@@ -33,8 +35,10 @@
3335
Is up and Running on Docker!
3436
</div>
3537
</h1>
36-
<p style="text-align: center">
37-
If you want to see some debugging information for this instance, click on the debug link: <a href="index.cfm?debug=true">see debugging</a>
38-
</p>
38+
<cfif debugEnabled>
39+
<p style="text-align: center">
40+
If you want to see some debugging information for this instance, click on the debug link: <a href="index.cfm?debug=true">see debugging</a>
41+
</p>
42+
</cfif>
3943
</body>
4044
</cfif>

0 commit comments

Comments
 (0)