CFHTTP not redirecting

101 views
Skip to first unread message

W. Williams

unread,
Oct 22, 2016, 6:16:52 PM10/22/16
to Lucee
So I just noticed that we were getting a blank page on a page that use to redirect.  I started catching the CFHTTP.Header and FileContent in a log for a test script under Lucee 5.0.1.67-SNAPSHOT.  I found a page that redirected using cflocation.  Here is the code:

<cfset LOCAL.Header_User_Agent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 Safari/602.1.50">
<cfhttp URL="http://www.greatkb.com/index.cfm" method="post" redirect="yes" useragent="#LOCAL.Header_User_Agent#">

<cfoutput>
#CFHTTP.Header#
<p></p>
#CFHTTP.FileContent#
</cfoutput>

Here is what I got:

HEADER
HTTP/1.1 302 302 Date: Sat, 22 Oct 2016 22:05:44 GMT Content-Type: text/html;charset=UTF-8 Transfer-Encoding: chunked Connection: keep-alive Set-Cookie: __cfduid=da1057ac81e74ce9dd78fbde9648e3cdd1477173944; expires=Sun, 22-Oct-17 22:05:44 GMT; path=/; domain=.greatkb.com.com; HttpOnly location: home.cfm Server: cloudflare-nginx CF-RAY: 2f60409e01830d79-SJC 

FILECONTENT 
<html>
<head>
<title>Document Moved</title>
</head>
<body>
<h1>Object Moved</h1>
<a HREF="home.cfm">here</a>
</body>
</html>

On another page I didn't get anything in the CFHTTP.FileContent but the Location header did come up.  Weird right.  Anyone have a clue why this is happening.  Is it happening on any of your servers?

Thanks!

andreas

unread,
Oct 24, 2016, 4:36:39 AM10/24/16
to lu...@googlegroups.com

I would check http headers with firebug directly. As far as I remember, the first letter of variable name "Location:" must be upper case.


--
Get 10% off of the regular price for this years CFCamp in Munich, Germany (Oct. 20th & 21st) with the Lucee discount code Lucee@cfcamp. 189€ instead of 210€. Visit https://ti.to/cfcamp/cfcamp-2016/discount/Lucee@cfcamp
---
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/132fb715-ba33-4e3d-a5c9-0bfc81d2ce2f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hugo Ahlenius

unread,
Oct 27, 2016, 2:41:22 AM10/27/16
to lu...@googlegroups.com
W. Williams wrote on 2016-10-23:
> So I just noticed that we were getting a blank page on a page that use
> to redirect. I started catching the CFHTTP.Header and FileContent in a
> log for a test script under Lucee 5.0.1.67-SNAPSHOT. I found a page
> that redirected using cflocation. Here is the code:

Does this apply?
https://luceeserver.atlassian.net/browse/LDEV-781
Reply all
Reply to author
Forward
0 new messages