summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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