summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/gitlab/http_io.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/gitlab/http_io.rb b/lib/gitlab/http_io.rb
index d47ee6e9b49..9d7763fc5ac 100644
--- a/lib/gitlab/http_io.rb
+++ b/lib/gitlab/http_io.rb
@@ -75,7 +75,7 @@ module Gitlab
end
end
- def read(length = nil, outbuf = "")
+ def read(length = nil, outbuf = nil)
out = []
length ||= size - tell
@@ -95,7 +95,10 @@ module Gitlab
out = out.join
# If outbuf is passed, we put the output into the buffer. This supports IO.copy_stream functionality
- outbuf = "#{outbuf[outbuf.bytesize,]}#{out}" if outbuf # rubocop:disable Lint/UselessAssignment
+ if outbuf
+ outbuf.replace(out)
+ end
+
out
end