BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
0ad0aa42
Commit
0ad0aa42
authored
Dec 21, 2016
by
Kamil Trzciński
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '25895-fix-headers-in-ci-api-helpers' into 'master'
Ensure nil User-Agent doesn't break the CI API Closes #25895 See merge request !8213
parents
8798b182
35971860
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
1 deletion
+10
-1
25895-fix-headers-in-ci-api-helpers.yml
...gelogs/unreleased/25895-fix-headers-in-ci-api-helpers.yml
+4
-0
helpers.rb
lib/ci/api/helpers.rb
+1
-1
builds_spec.rb
spec/requests/ci/api/builds_spec.rb
+5
-0
No files found.
changelogs/unreleased/25895-fix-headers-in-ci-api-helpers.yml
0 → 100644
View file @
0ad0aa42
---
title
:
Ensure nil User-Agent doesn't break the CI API
merge_request
:
author
:
lib/ci/api/helpers.rb
View file @
0ad0aa42
...
...
@@ -60,7 +60,7 @@ module Ci
end
def
build_not_found!
if
headers
[
'User-Agent'
].
match
(
/gitlab-ci-multi-runner \d+\.\d+\.\d+(~beta\.\d+\.g[0-9a-f]+)? /
)
if
headers
[
'User-Agent'
].
to_s
.
match
(
/gitlab-ci-multi-runner \d+\.\d+\.\d+(~beta\.\d+\.g[0-9a-f]+)? /
)
no_content!
else
not_found!
...
...
spec/requests/ci/api/builds_spec.rb
View file @
0ad0aa42
...
...
@@ -37,6 +37,11 @@ describe Ci::API::Builds do
let
(
:user_agent
)
{
'Go-http-client/1.1'
}
it
{
expect
(
response
).
to
have_http_status
(
404
)
}
end
context
"when runner doesn't have a User-Agent"
do
let
(
:user_agent
)
{
nil
}
it
{
expect
(
response
).
to
have_http_status
(
404
)
}
end
end
context
'when there is a pending build'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment