Skip to content

Prevent Double Slash in Review Apps Path

Jason Goodman requested to merge double-slash-64592 into master

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

Performance and testing

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
Edited by Kamil Trzciński

Merge request reports