Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
06-17-2003, 03:17 AM #1
- Join Date
- Dec 2002
- Central New York
- Thanked 0 Times in 0 Posts
Ruby CGI Puts Newline (HTTP Header)
I'm writing a CGI script using Ruby. From my understanding, the difference between puts and print is that puts appends a newline character after the string, print doesn't.
So here's my question... in the example, why does the correct code need two newlines if one is already being outputted by puts? Wouldn't that really make it 3 newlines outputted, one newline more than RFC1945 asks for? In my mind, the incorrect code is just as valid.
INCORRECT: puts "Content-Type: text/plain\n"
CORRECT: puts "Content-Type: text/plain\n\n"