FIX: Allow additional valid theme .git url formats (#12385)

Some git repos have a different ssh url scheme than github and we should
support them.

This change updates our regex format to account for repos that don't
start with "git", but are still valid ssh urls.

Also I added some tests to account for the various formats and to ensure
we don't show the public key when using https urls.

See: https://meta.discourse.org/t/182668
This commit is contained in:
Blake Erickson
2021-03-12 13:24:55 -07:00
committed by GitHub
parent ca436e429b
commit 85870225f2
2 changed files with 30 additions and 1 deletions

View File

@ -24,7 +24,7 @@ export default Controller.extend(ModalFunctionality, {
keyGenUrl: "/admin/themes/generate_key_pair",
importUrl: "/admin/themes/import",
recordType: "theme",
checkPrivate: match("uploadUrl", /^git/),
checkPrivate: match("uploadUrl", /^.*[@].*[:].*\.git$/),
localFile: null,
uploadUrl: null,
uploadName: null,