Displaying 1 result from an estimated 1 matches for "nline1".
Did you mean:
nlines
2006 Feb 12
0
problem serving files which start with newlines
...ith newlines they
get lost in the process and the browser marks the download as failed
because the received filesize is smaller then the expected filesize (the
difference is exactly the newlines missing).
To reproduce this place something like this an a controller
def foo
send_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...