Skip to content

Fix problems sanitizing URLs with empty passwords

Nick Thomas requested to merge (removed):url-sanitizer-fixes into master

What does this MR do?

Backports a fix from EE: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/2810

Also ensures that if Gitlab::UrlSanitizer receives an empty password in credentials, it will output an url like ssh://user@example.com rather than ssh://user:@example.com. The latter breaks if used in a git remote.

Are there points in the code the reviewer needs to double check?

The tests have been reworked to be table-based, and now cover many more eventualities

Why was this MR needed?

Mostly for EE features, but the code is in CE as well for importing.

Screenshots (if relevant)

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes https://gitlab.com/gitlab-org/gitlab-ee/issues/3352

Edited by Nick Thomas

Merge request reports