summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-03-31 14:45:49 +0100
committerAlfredo Sumaran <alfredo@gitlab.com>2017-04-07 12:43:06 -0500
commit0e643752b9a58e6177db2581a015114111e2b952 (patch)
treed8dd1c40c663a2f57e394b07b5e54735ed97460f
parente75648c3c183265cf7d2c4be2985b1f0873ae68b (diff)
downloadgitlab-ce-0e643752b9a58e6177db2581a015114111e2b952.tar.gz
Update to match new API - merges the two requests and adds truncated information when provided
-rw-r--r--lib/ci/ansi2html.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/ci/ansi2html.rb b/lib/ci/ansi2html.rb
index 77670fa2b8d..9338ab062dd 100644
--- a/lib/ci/ansi2html.rb
+++ b/lib/ci/ansi2html.rb
@@ -136,7 +136,7 @@ module Ci
def convert(stream, new_state)
reset_state
- restore_state(new_state) if new_state.present?
+ restore_state(new_state, stream) if new_state.present?
append = false
truncated = false
@@ -255,10 +255,10 @@ module Ci
Base64.urlsafe_encode64(state.to_json)
end
- def restore_state(new_state)
+ def restore_state(new_state, stream)
state = Base64.urlsafe_decode64(new_state)
state = JSON.parse(state, symbolize_names: true)
- return if state[:offset].to_i > raw.length
+ return if state[:offset].to_i > stream.size
STATE_PARAMS.each do |param|
send("#{param}=".to_sym, state[param])