summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2018-07-31 10:34:14 +0000
committerKamil Trzciński <ayufan@ayufan.eu>2018-07-31 10:34:14 +0000
commiteb8597a1b9eb575121f09b8b9904c0ad7cd489cc (patch)
treee079ad26acd633841a7b6ec56fc43f7dd1c5fb96
parent84626f0d07898d4e0df1989a0ed026e7b37d1d81 (diff)
parent18a1bcf862e03e1f7f52efb8169521d315d263c5 (diff)
downloadgitlab-ce-eb8597a1b9eb575121f09b8b9904c0ad7cd489cc.tar.gz
Merge branch '25990-interactive-web-terminals-authorization' into 'master'
Fix authorization for interactive web terminals See merge request gitlab-org/gitlab-ce!20811
-rw-r--r--app/models/ci/build_runner_session.rb2
-rw-r--r--changelogs/unreleased/25990-interactive-web-terminals-authorization.yml5
-rw-r--r--spec/models/ci/build_runner_session_spec.rb2
3 files changed, 7 insertions, 2 deletions
diff --git a/app/models/ci/build_runner_session.rb b/app/models/ci/build_runner_session.rb
index 6f3be31d8e1..869dc0ccadf 100644
--- a/app/models/ci/build_runner_session.rb
+++ b/app/models/ci/build_runner_session.rb
@@ -17,7 +17,7 @@ module Ci
{
subprotocols: ['terminal.gitlab.com'].freeze,
url: "#{url}/exec".sub("https://", "wss://"),
- headers: { Authorization: authorization.presence }.compact,
+ headers: { Authorization: [authorization.presence] }.compact,
ca_pem: certificate.presence
}
end
diff --git a/changelogs/unreleased/25990-interactive-web-terminals-authorization.yml b/changelogs/unreleased/25990-interactive-web-terminals-authorization.yml
new file mode 100644
index 00000000000..0a2853c20c6
--- /dev/null
+++ b/changelogs/unreleased/25990-interactive-web-terminals-authorization.yml
@@ -0,0 +1,5 @@
+---
+title: Fix authorization for interactive web terminals
+merge_request: 20811
+author:
+type: fixed
diff --git a/spec/models/ci/build_runner_session_spec.rb b/spec/models/ci/build_runner_session_spec.rb
index 7183957aa50..35622366829 100644
--- a/spec/models/ci/build_runner_session_spec.rb
+++ b/spec/models/ci/build_runner_session_spec.rb
@@ -29,7 +29,7 @@ describe Ci::BuildRunnerSession, model: true do
it 'adds Authorization header if authorization is present' do
subject.authorization = 'whatever'
- expect(terminal_specification[:headers]).to include(Authorization: 'whatever')
+ expect(terminal_specification[:headers]).to include(Authorization: ['whatever'])
end
end
end