Tclhttpd: why not return the HTTP status from Direct_Url?



Hi all,

I just had a look at the Direct_Url command in tclhttpd, which installs all procedures in a namespace as URL's, e.g.

Direct_Url /hello ::hello::
proc ::hello::/world {args} {
...
return "<b>hello world</b>"
}

Is there any particular reason to not return the HTTP code from Direct_Url's, so that e.g. one can define ::hello::/world like this:

proc ::hello::/world {args} {
...
return -code 400 "<i>wrong # args, should be ...</i>"
}

??

Looking at the code in lib/direct.tcl, this would just require some minor changes to the procedure DirectRespond: capture the code and give it as argument to Httpd_ReturnData. Currently every code except ok and 302 leads to an error.
However, I don't know all the side effects this would have besides returning the HTTP status... Any ideas?


TIA
Eckhard
.