diff options
author | Tomasz Maczukin <tomasz@maczukin.pl> | 2016-04-19 16:48:16 +0300 |
---|---|---|
committer | Tomasz Maczukin <tomasz@maczukin.pl> | 2016-04-20 12:54:06 +0300 |
commit | a84d0204bf754690229cf62ea84f494c037b82a5 (patch) | |
tree | c47d2b32deb19e8cbb7c95fb280215e5af810172 /lib | |
parent | 4019b0d872bd2b183a06bdc832f5a100c8a88a00 (diff) |
Fix Build#append_trace method usage when trace file doesn't exists yet
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ci/api/builds.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/ci/api/builds.rb b/lib/ci/api/builds.rb index 08a2b006a5f..607359769d1 100644 --- a/lib/ci/api/builds.rb +++ b/lib/ci/api/builds.rb @@ -71,8 +71,9 @@ module Ci content_range = request.headers['Content-Range'] content_range = content_range.split('-') - unless build.trace_length == content_range[0].to_i - return error!('416 Range Not Satisfiable', 416, { 'Range' => "0-#{build.trace_length}" }) + current_length = build.trace_length + unless current_length == content_range[0].to_i + return error!('416 Range Not Satisfiable', 416, { 'Range' => "0-#{current_length}" }) end build.append_trace(request.body.read, content_range[0].to_i) |