Dave and everyone else, I actually solved this one!

I couldn't view the headers, but with a little bump from Ben Nadel's blog 

http://www.bennadel.com/blog/758-ColdFusion-GetPageContext-Massive-Exploration.htm

I was able to come up with this:  (I'm using Pragma as an example but can be 
used for any header created with CFHeader):

<cfset getPageContext().getResponse().setHeader("pragma", "") />

The first part of the setHeader is a string that has the header name, the 
second is a string with a value. By using blank ("") it actually removed the 
header from being passed.

I tested this with Firefox & firedebug. The header was actually gone. I was 
also able to do things like:

<cfset getPageContext().getResponse().setHeader("Last-Modified","Steve!") /> 
which sent Steve! Instead of the file date.

However, this didn't work exactly:
<cfset getPageContext().getResponse().setHeader("X-Powered-By", "Steve") /> it 
didn't work exactly as expected because the X-Powered-By was actually set by 
IIS. So instead of Steve I got X-Powered-By: Steve, ColdFusion8. Which when you 
look at how headers are supposed to work it did what it is supposed to.

Just have to remember that you can only "change" things that existed before and 
during the request, the webserver can still add stuff!

Steve


-----Original Message-----
From: DURETTE, STEVEN J 
Sent: Tuesday, February 21, 2012 12:12 PM
To: 'cf-talk@houseoffusion.com'
Subject: RE: Editing the http info before it goes to the browser.

Dave,

How would I do that? I have to include the Application.cfm from the higher 
level (part of the requirements) and in that file is a cfheader (actually  a 
lot of them) but I'm only concerned with the one.

Steve


-----Original Message-----
From: Dave Watts [mailto:dwa...@figleaf.com] 
Sent: Tuesday, February 21, 2012 12:08 PM
To: cf-talk
Subject: Re: Editing the http info before it goes to the browser.

You can't really do anything about that directly. But you could create
your own Application.cfc/cfm and override whatever's being done at
that higher level.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:350004
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to