diff options
author | Toon Claes <toon@gitlab.com> | 2018-03-11 22:38:29 +0100 |
---|---|---|
committer | Toon Claes <toon@gitlab.com> | 2018-03-11 22:42:26 +0100 |
commit | e69fcdff0cdca248ea700b2aeeeaebdc74d6bb07 (patch) | |
tree | 5dbc45e663a66a00ee30546356c0f7c723a805b2 | |
parent | afd2d381119c3778140c3dd63c7ef24ecdb4c62e (diff) | |
download | gitlab-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.yml | 5 | ||||
-rw-r--r-- | lib/api/helpers/related_resources_helpers.rb | 2 |
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 |