summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToon Claes <toon@gitlab.com>2018-03-11 22:38:29 +0100
committerToon Claes <toon@gitlab.com>2018-03-11 22:42:26 +0100
commite69fcdff0cdca248ea700b2aeeeaebdc74d6bb07 (patch)
tree5dbc45e663a66a00ee30546356c0f7c723a805b2
parentafd2d381119c3778140c3dd63c7ef24ecdb4c62e (diff)
downloadgitlab-ce-tc-api-fix-expose_url.tar.gz
Respect the protocol in `expose_url`tc-api-fix-expose_url
When https is configured in the URL, also use that, and do not set it to http. Closes gitlab-org/gitlab-ee#5217
-rw-r--r--changelogs/unreleased/tc-api-fix-expose_url.yml5
-rw-r--r--lib/api/helpers/related_resources_helpers.rb2
2 files changed, 6 insertions, 1 deletions
diff --git a/changelogs/unreleased/tc-api-fix-expose_url.yml b/changelogs/unreleased/tc-api-fix-expose_url.yml
new file mode 100644
index 00000000000..c701f64d6bf
--- /dev/null
+++ b/changelogs/unreleased/tc-api-fix-expose_url.yml
@@ -0,0 +1,5 @@
+---
+title: Ensure the API returns https links when https is configured
+merge_request: 17681
+author:
+type: fixed
diff --git a/lib/api/helpers/related_resources_helpers.rb b/lib/api/helpers/related_resources_helpers.rb
index 1f677529b07..7f4d6e58b34 100644
--- a/lib/api/helpers/related_resources_helpers.rb
+++ b/lib/api/helpers/related_resources_helpers.rb
@@ -15,7 +15,7 @@ module API
url_options = Gitlab::Application.routes.default_url_options
protocol, host, port = url_options.slice(:protocol, :host, :port).values
- URI::HTTP.build(scheme: protocol, host: host, port: port, path: path).to_s
+ URI::Generic.build(scheme: protocol, host: host, port: port, path: path).to_s
end
private