summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2018-02-06 15:56:48 +0000
committerNick Thomas <nick@gitlab.com>2018-02-06 15:56:48 +0000
commit805799b71b059b1bfb3578c4e78db3030ec04b6a (patch)
tree5a2ecddaf2283ea6409218c4920ae23134021dd7
parent9ab4c5b735e0e121996b092cb20bcdc423045c5e (diff)
parent11f882ca437337ebd04331b9e96217f1d48be93e (diff)
downloadgitlab-ce-805799b71b059b1bfb3578c4e78db3030ec04b6a.tar.gz
Merge branch 'bump-workhorse' into 'master'
Upgrade GitLab Workhorse to v3.6.0 See merge request gitlab-org/gitlab-ce!16946
-rw-r--r--GITLAB_WORKHORSE_VERSION2
-rw-r--r--changelogs/unreleased/bump-workhorse.yml5
-rw-r--r--lib/gitlab/workhorse.rb12
-rw-r--r--spec/lib/gitlab/workhorse_spec.rb17
4 files changed, 35 insertions, 1 deletions
diff --git a/GITLAB_WORKHORSE_VERSION b/GITLAB_WORKHORSE_VERSION
index d5c0c991428..40c341bdcdb 100644
--- a/GITLAB_WORKHORSE_VERSION
+++ b/GITLAB_WORKHORSE_VERSION
@@ -1 +1 @@
-3.5.1
+3.6.0
diff --git a/changelogs/unreleased/bump-workhorse.yml b/changelogs/unreleased/bump-workhorse.yml
new file mode 100644
index 00000000000..37ee402dac7
--- /dev/null
+++ b/changelogs/unreleased/bump-workhorse.yml
@@ -0,0 +1,5 @@
+---
+title: Upgrade GitLab Workhorse to v3.6.0
+merge_request:
+author:
+type: other
diff --git a/lib/gitlab/workhorse.rb b/lib/gitlab/workhorse.rb
index b3f8b0d174d..823df67ea39 100644
--- a/lib/gitlab/workhorse.rb
+++ b/lib/gitlab/workhorse.rb
@@ -161,6 +161,18 @@ module Gitlab
]
end
+ def send_url(url, allow_redirects: false)
+ params = {
+ 'URL' => url,
+ 'AllowRedirects' => allow_redirects
+ }
+
+ [
+ SEND_DATA_HEADER,
+ "send-url:#{encode(params)}"
+ ]
+ end
+
def terminal_websocket(terminal)
details = {
'Terminal' => {
diff --git a/spec/lib/gitlab/workhorse_spec.rb b/spec/lib/gitlab/workhorse_spec.rb
index 2e7a0265a0b..dc2bb5b9747 100644
--- a/spec/lib/gitlab/workhorse_spec.rb
+++ b/spec/lib/gitlab/workhorse_spec.rb
@@ -465,4 +465,21 @@ describe Gitlab::Workhorse do
end
end
end
+
+ describe '.send_url' do
+ let(:url) { 'http://example.com' }
+
+ subject { described_class.send_url(url) }
+
+ it 'sets the header correctly' do
+ key, command, params = decode_workhorse_header(subject)
+
+ expect(key).to eq("Gitlab-Workhorse-Send-Data")
+ expect(command).to eq("send-url")
+ expect(params).to eq({
+ 'URL' => url,
+ 'AllowRedirects' => false
+ }.deep_stringify_keys)
+ end
+ end
end