On Mon, 2005-10-24 at 12:00 -0600, Josh Rosenbaum wrote:
> Kiffin Gish wrote:
> > Apache chokes with the following 500-error: 'bad header=\r\r\r', and 
> > upon examining the output more closely, I discover the following hex 
> > content:
> > 
> > 0D0D0D0DContent-Type
> > 
> > Seems that despite using the chomp directives the \r is still hiding in 
> > there.
> > 
> > Can anyone help me?
> 
> I believe Randal is right here. If you take a look at Parser.pm, a lot of 
> line returns are cleared via: "\n". I'd suggest trying a text editor that 
> will let you save to unix/linux format which is only "\n"'s. (Or see if your 
> current one allows it.)
> 
> Either that, or if you're using windows, you can post process the result from 
> template toolkit by doing something like this:
> For Windows: "s:\r\r+(\r\n)?:$1:g".
> 
> But for Apple, which uses all "\r"'s I believe, I think post processing would 
> just be a kludge since you would not be able to tell where you need to keep 
> the line returns. (s:\r\r+:: will most likely remove things you don't want it 
> to remove.)
> 
> I think if you can just save in unix format (\n only) then that would 
> probably be the best way to handle this.
> 
> -- Josh
> 
> _______________________________________________
> templates mailing list
> [email protected]
> http://lists.template-toolkit.org/mailman/listinfo/templates

Thanks but I am afraid you do not understand my problem exactly.

This has nothing to do with whether or not it is Windows and opening it
in a proper text editor.

This is generated by a /cgi-bin/tt_dir/index.pl script on the fly as
dynamic content.

Apache expects the content to start with Content-Type, but because it
begin with \r\r\r '0D0D0D' instead, Apache doesn't understand it --
thereby generating the 500-error.

-- 
Kiffin Gish
Gouda, The Netherlands


_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to