Displaying 1 result from an estimated 1 matches for "extract_header_and_body".
2006 Feb 12
0
problem serving files which start with newlines
...data "\nline1\nline2|"
  end
and the downloaded file will contain only "line1\nline2|".
I think I tracked the problem down to webrick_server.rb around line 115. 
A StringIO object is created, filled with the data and then this is 
split into header and body by calling ''extract_header_and_body''. Before 
this call the newlines are still there and after it they are missing. 
''extract_header_and_body'' uses ''*data.split(/^[\xd\xa]+/on, 2)'' to split 
up header and body and that regular expression seems to swallow not only 
the one newline separatin...