First off, it was great to meet and converse with so many of you at CFObjective! I'm already looking forward to next year!
I'm debating whether or not this is an app issue or an IIS issue....
In my API I am returning a 204 status header on some of my endpoints. 204 does not send any content back so I use event.noRender() after my endpoint executes. The problem that is occurring however is the content-length header is returning a value (ie 2629) when it should really return 0. I tried to force a content-length header with value 0 at the end of my request but it doesn't seem to overwrite the value. I'm struggling to figure out how to correct this, and can't determine why/how the content-length header is populated with that value. Hoping someone on the list might have an approach.
Cheers, and thanks.
Nolan
Aaron Greenlee
Makes sense. I'll give that a go and let you know if that does the trick. Thanks.
Nolan
On 2011-05-18, at 3:03 PM, Aaron Greenlee wrote:
> My guess is you are seeing the amount of whitepace generated by ColdFusion. In the event you need "zero" content, perhaps you could try calling clearBuffer() as the last item in the request? I think you have to do this before onRequestEnd, but, I'm not sure.
>
> Aaron Greenlee
>
> --
> You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
> To post to this group, send email to col...@googlegroups.com
> To unsubscribe from this group, send email to coldbox-u...@googlegroups.com
> For more options, visit this group at http://groups-beta.google.com/group/coldbox
> For News, visit http://blog.coldbox.org
> For Documentation, visit http://wiki.coldbox.org
Is clearBuffer() part of the CB framework or is this native to CF? i.e getPageContext().getCFOutput()
Thanks.
Nolan
On 2011-05-18, at 3:03 PM, Aaron Greenlee wrote:
> My guess is you are seeing the amount of whitepace generated by ColdFusion. In the event you need "zero" content, perhaps you could try calling clearBuffer() as the last item in the request? I think you have to do this before onRequestEnd, but, I'm not sure.
>
> Aaron Greenlee
>
There are a two ways:
getPageContext().getOut().clearBuffer();
<cfcontent reset="true">
It looks like this will work with getPageContext()..... however I only want this this to execute on responses with 204. I'm setting the 204 header further up the request chain so i'm wondering how I would programatically call the clearBuffer() only if the 204 header had been set. Would this be as simple as adding a var to the RC or PRC and checking for it's existence in the onRequestEnd()? If exists, clearBuffer()? Or would you suggest another approach to evaulate the 204 header?
Thanks very much.
Nolan