Detecting HTTPS using x-https

You can use x headers to detect if the URL is using HTTP or HTTPS, you will find the header x-https only exists in the GetHttpRequestData() method when using HTTPS. Below is a simple IF statement to detect this:

<cfif StructKeyExists(GetHttpRequestData().headers, 'x-https')>
HTTPS
<cfelse>
HTTP
</cfif>

Seeing all x headers:

You can use the following code to dump call request headers that tomcat proxy will detect:

<cfdump(GetHttpRequestData())>

  • Lucee, HTTPS, SSL
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

CFML Compatibility

Railo tries to adhere the CFML standard as good as possible, Still there are some differences...

Frameworks

Here's a list of the most important CFML frameworks that have been tested successfully with Railo...

Applications

We have tested several applications for the functionality with Railo 3.0. Here's a list of the...

Railo Administrator

Railo comes with two kinds of administrators. The Railo Server Administrator and the Railo Web...