Prevent Double Slash in Review Apps Path
What does this MR do?
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/64592
A .gitlab-ci.yml
file with an environment url like this:
environment:
url: 'https://my-domain.com/project-sub-path/'
Along with a .gitlab/route-maps.yml
with something like this:
- source: 'static/hello.html'
public: 'public/pages/hello'
Will result in a url with a double slash in the links to review app pages. In this example, https://my-domain.com/project-sub-path//public/pages/hello
.
This corrects the issue so that the url will be https://my-domain.com/project-sub-path/public/pages/hello
.
In other words, the environment url
in .gitlab-ci.yml
now tolerates a trailing slash.
This MR also adds tolerance for a leading slash on the public
path in a .gitlab/route-maps.yml
file.
An environment url
of https://my-domain.com/project-sub-path/
along with a public
path in the route map of /public/file.html
will result in a full url of https://my-domain.com/project-sub-path/public/file.html
.
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry for user-facing changes, or community contribution. Check the link for other scenarios. -
Documentation created/updated or follow-up review issue created -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Performance and testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team