Hello,
I'm trying to use ns_register_filter, and am running into difficulties.
I have the following code in an init.tcl:
ns_register_filter postauth GET /*/bob mqa.processHostedRequest
ns_register_filter postauth POST /*/bob mqa.processHostedRequest
mqa.processHostedRequest looks like this:
proc mqa.processHostedRequest {trash} {
if [catch {
ns_return 200 text/html [ns_adp_parse -file /path/to/common.adp]
} err] {
mqa.logError "mqa.processHostedRequest: '$err'"
}
return filter_break
}
I would like common.adp to be parsed and returned, and then for the
connection to be closed -- no attempt should be made to actually load
'bob', since it doesn't exist.
This is only half-working. The parsing is happing and I'm seeing the
output, but afterward, I get a second set of headers:
HTTP/1.0 404 Not Found
MIME-Version: 1.0
Date: Fri, 14 Feb 2003 21:31:46 GMT
Server: AOLserver/3.5.5
Content-Type: text/html
Content-Length: 21499
Connection: close
Content-Type: text/html
Content-Length: 547
Notice the two sets of Content-Type and Content-Length headers.. strange.
Does anyone have any idea what's going on here?
I could see getting a 404 if aolserver was trying to load the requested page, since it
doesn't exist.
>From the docs (ns_register_filter, postauth section:
* TCL_BREAK (using: return "filter_break"): The server will not
process any more post-authorization filters for this connection,
and it will run the function registered to handle this request.
Thoughts? Ideas?
thanks
Ross
--
Ross Simpson
Associate Software Engineer | MapQuest.com
[EMAIL PROTECTED] | 303.312.0187