diff options
Diffstat (limited to 'lib/webrick/httpresponse.rb')
-rw-r--r-- | lib/webrick/httpresponse.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/webrick/httpresponse.rb b/lib/webrick/httpresponse.rb index 820579237f..6d77692140 100644 --- a/lib/webrick/httpresponse.rb +++ b/lib/webrick/httpresponse.rb @@ -433,7 +433,12 @@ module WEBrick size = @header['content-length'] size = size.to_i if size end - @sent_size = IO.copy_stream(@body, socket, size, offset) + begin + @sent_size = IO.copy_stream(@body, socket, size, offset) + rescue NotImplementedError + @body.seek(offset, IO::SEEK_SET) + @sent_size = IO.copy_stream(@body, socket, size) + end end ensure @body.close |