Commit 98780b7e authored by Catalin Irimie's avatar Catalin Irimie

Redirect Geo git push operations to primary external URL

Instead of redirecting to the primary Geo internal URL in a git push
operation, this now always redirects to the external URL.

This didn't work previously with internal URLs that were not public,
or inaccessible to the regular users who may be pushing through
a Geo secondary site.

Changelog: fixed
EE: true
parent d0834485
......@@ -220,7 +220,7 @@ module EE
File.join(geo_secondary_referrer_path_prefix, geo_request_fullpath_for_primary)
end
::Gitlab::Utils.append_path(::Gitlab::Geo.primary_node.internal_url, path)
::Gitlab::Utils.append_path(::Gitlab::Geo.primary_node.url, path)
end
def geo_secondary_referrer_path_prefix
......
......@@ -13,8 +13,9 @@ RSpec.describe "Git HTTP requests (Geo)", :geo do
let_it_be(:project_no_repo) { create(:project, :private) }
let_it_be(:primary_url) { 'http://primary.example.com' }
let_it_be(:primary_internal_url) { 'http://primary-internal.example.com' }
let_it_be(:secondary_url) { 'http://secondary.example.com' }
let_it_be(:primary) { create(:geo_node, :primary, url: primary_url) }
let_it_be(:primary) { create(:geo_node, :primary, url: primary_url, internal_url: primary_internal_url) }
let_it_be(:secondary) { create(:geo_node, url: secondary_url) }
let!(:user) { create(:user) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment