I'm using CF8 on IIS6/Win2003 Server.
In my cfm I have:
<cfset reqheaders=GetHttpRequestData().headers> <cfdump var="#reqheaders#">
|Host||[my test server]|
|User-Agent||Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:188.8.131.52) Gecko/20090824 Firefox/3.5.3|
But if I look at the actual headers being sent from my browser (using Firefox LiveHTTP add-on), it shows I am sending "If-Modified-Since" and "If-None-Match" headers.
GET /path/to/cfmfile.cfm HTTP/1.1 Host: [removed] User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:184.108.40.206) Gecko/2009011913 Firefox/3.0.6 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Cookie: CFID=[removed]; CFTOKEN=[removed]; If-Modified-Since: Fri, 18 Sep 2009 01:18:19 GMT If-None-Match: ""0134E50193C69AD753656B0513FCB28C"" Cache-Control: max-age=0
Is there some reason IIS would "steal" those headers before handing over control to ColdFusion? Or does GetHttpRequestData sometimes "miss" headers? Other ideas? Is there any other way I can get at the raw HTTP request from within ColdFusion?
I'm at a loss. Others have used the same process and no one seems to have this issue.
I've tried accessing the page using Internet Explorer instead. It also is not showing those headers, but I have not sniffed IE's actual headers being sent so I can't be sure those headers are included (but I think they are, since IE implements conditional GET).
Found out the answer. IIS 6 does in fact steal "If-Modified-Since" and "If-None-Match" headers, but only on custom 404 redirects. That's actually what I'm doing here (that'll teach me not to put details in a question when I think they're irrelevant -- actually I just forgot).
Here's two discussions on the issue (they're using ASP, but apparently it's the same for ColdFusion):