diff options
author | Tomasz Maczukin <tomasz@maczukin.pl> | 2016-09-06 15:30:54 +0300 |
---|---|---|
committer | Tomasz Maczukin <tomasz@maczukin.pl> | 2016-09-13 18:44:18 +0300 |
commit | 940f900f1cc5343c6ba753b6570ca56caa93f8fd (patch) | |
tree | af4a021953071fd6dd5a32e71d48016864b2176c /lib/ci | |
parent | 404f438f45c2da884cf4f16239ac1fda548db09f (diff) |
Change response for /ci/api/v1/builds/register.json from 404 to 204
Diffstat (limited to 'lib/ci')
-rw-r--r-- | lib/ci/api/builds.rb | 2 | ||||
-rw-r--r-- | lib/ci/api/helpers.rb | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/ci/api/builds.rb b/lib/ci/api/builds.rb index 54db63d4628..59f85416ee5 100644 --- a/lib/ci/api/builds.rb +++ b/lib/ci/api/builds.rb @@ -27,7 +27,7 @@ module Ci else Gitlab::Metrics.add_event(:build_not_found) - not_found! + build_not_found! end end diff --git a/lib/ci/api/helpers.rb b/lib/ci/api/helpers.rb index bcabf7a21b2..ba80c89df78 100644 --- a/lib/ci/api/helpers.rb +++ b/lib/ci/api/helpers.rb @@ -32,6 +32,14 @@ module Ci end end + def build_not_found! + if headers['User-Agent'].match(/gitlab-ci-multi-runner \d+\.\d+\.\d+(~beta\.\d+\.g[0-9a-f]+)? /) + no_content! + else + not_found! + end + end + def current_runner @runner ||= Runner.find_by_token(params[:token].to_s) end |