On 28 Jan 2006, at 22:42, Aparajita Fishman wrote:
How do I use the A4D_PostExecuteHook to change
$ioResponseHeaderValues{2} to 200 when the code is 404?
I would imagine it would be something like:
If ($ioResponseHeaderValues->{A4D Response Status} = "404")
$ioResponseHeaderValues->{A4D Response Status} := "200"
End if
Note the full A4D_PostExecuteHook should look like this:
`METHOD: A4D_PostExecuteHook(
` ioResponseHeaderNames: ->Text Array;
` ioResponseHeaderValues: ->Text Array;
` ioResponse: ->BLOB;
`
`Part of Active4D, the ultimate 4D web environment
`Copyright © 2001-2005 Aparajita Fishman, All Rights Reserved
`
`$Id: A4D_PostExecuteHook.4d 875 2006-01-28 22:17:42Z aparajita $
C_POINTER($1;$ioResponseHeaderNames;$2;$ioResponseHeaderValues;$3;$ioRe
sponse)
$ioResponseHeaderNames:=$1
$ioResponseHeaderValues:=$2
$ioResponse:=$3
`----------------------------------------------------------------
`Modify the headers or response here
`----------------------------------------------------------------
`----------------------------------------------------------------
`If you modify ioResponse, change if (False) in the next line to if
(True)
`----------------------------------------------------------------
If (False)
C_LONGINT($index)
$index:=Find in array($ioResponseHeaderNames->;"Content-Length")
If ($index>0)
$ioResponseHeaderValues->{$index}:=String(BLOB
size($ioResponse->))
End if
End if
So should all of the above be in the 'A4D_PostExecuteHook' method?
David Wright
_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/