|
From: Arjen v. d. M. <ar...@gl...> - 2004-04-10 17:10:59
|
On 10-4-2004 17:51, Olly Betts wrote:
> On Fri, Apr 09, 2004 at 03:02:54PM +0200, Arjen van der Meijden wrote:
>
>>On 10-3-2004 15:34, Olly Betts wrote:
>>
>>>In this case, it's probably because Omega currently always sends
>>>"Content-Type: text/html". 0.8.0 will add the "$httpheader" command to
>>>Omegascript, so I'll fix the xml template to use this to return
>>>"Content-Type: text/xml" instead.
>>
>>Can you change that behavior, to not force a header on the cli ?
>
>
> The command line mode for Omega is primarily intended to allow testing
> and debugging - it's much easier to attach a debugger to a command line
> process than a CGI one. If we start making behaviour conditional on
> whether we're running from CGI or the command line, it would get in
> the way of such use.
Well, it's also a nice way to use it as a backend process, instead of a
frontend application. It saves a lot of hassle to create your own
"omega-like" application. But HTTP-headers on the command line or at a
pipe are a bit odd :)
>>Or at least allow the header to be disabled?
>
>
> It can be - just remove the $httpheader{...} line from the omegascript
> template. The xml template is really just an example, and you'll
> generally want to customise it - for example, you should remove the
> topterms stuff if you aren't using it as it takes a significant time to
> calculate the topterms.
We don't use the XML-template, I was referring to the Content-Type
header, which is always put on top of the output of omega. Even if there
is no $httpheader{}-command.
I've removed the code which prepends that header for now from query.cc,
but I don't think that is the best way.
Perhaps a nicer way is to not prepend a header if nothing is done and
still allow the $httpheader{}-command to override that default?
Best regards,
Arjen van der Meijden
|