From: Jim Menard Date: 2005-01-29T03:48:20+09:00 Subject: Re: Apache -> malformed header from script Douglas Livingstone wrote: > Hi all, > > I'm on windows xp trying, playing with Ruby on Apache. I've put this > in httpd.conf: > > AddHandler cgi-script .rb > > And this in index.rb: > > #!ruby > > print "HTTP/1.0 200 OK\r\n" > print "Content-type: text/html\r\n\r\n" > print "Hello World!\r\n" > > This comes up as a 500 error, with this in the log file: > > malformed header from script. Bad header=HTTP/1.0 200 OK: index.rb > > Any idea what I'm missing? Try just "\n" instead of "\r\n". Since you're on Windows, I think Ruby will output "\r\n" when you use "\n". You may be sending too many newlines. (I've also just used "\n" on Unix for this kind of thing before, and it always worked fine.) Jim -- Jim Menard, jimm@io.com, http://www.io.com/~jimm