Geo mimicry: Use relative URLs where possible
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
As part of &5914 (closed), we can proxy through Geo secondaries while using a different URL.
There are absolute redirects in our frontend, for example during snippet creation, which cause write operations on the secondary to get redirected to the primary unexpectedly.
In the frontend, they are mostly calls to redirectTo()
which uses window.location.assign
which can receive relative paths.
Implementation Guide
-
Find absolute paths in GitLab Rails -
For each one, check if we can use a relative path instead of the absolute URL (as some of the redirects already use). -
If it is ok to use a relative path, then open an MR to change it -
If it is not ok to use a relative path, then link to the line of code in #339262
-
For example, a relative path is like "foo/bar"
, and an absolute URL is like "https://gitlab.example.com/foo/bar"
.
Edited by 🤖 GitLab Bot 🤖