summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2016-05-19 03:00:01 +0000
committerRobert Speicher <robert@gitlab.com>2016-05-19 03:00:01 +0000
commit4607323e130fe5b04e830f7a6de8083b070808f1 (patch)
treea00611843950a53a5963e5a2a31e748e11102246 /app
parent26eb3dd731c8eb8ade81a77f34c0444d693ac22a (diff)
parent0c47b68d0474b595bb03a49ce755c96f5d00fbf1 (diff)
downloadgitlab-ce-4607323e130fe5b04e830f7a6de8083b070808f1.tar.gz
Merge branch 'issue_17560' into 'master'
Mask credentials from URL when the import of project has failed. REF: #17560 See merge request !4185
Diffstat (limited to 'app')
-rw-r--r--app/models/project.rb4
-rw-r--r--app/workers/repository_import_worker.rb2
2 files changed, 3 insertions, 3 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index 907d80c0681..9a34198e098 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -369,14 +369,14 @@ class Project < ActiveRecord::Base
end
def import_url=(value)
- import_url = Gitlab::ImportUrl.new(value)
+ import_url = Gitlab::UrlSanitizer.new(value)
create_or_update_import_data(credentials: import_url.credentials)
super(import_url.sanitized_url)
end
def import_url
if import_data && super
- import_url = Gitlab::ImportUrl.new(super, credentials: import_data.credentials)
+ import_url = Gitlab::UrlSanitizer.new(super, credentials: import_data.credentials)
import_url.full_url
else
super
diff --git a/app/workers/repository_import_worker.rb b/app/workers/repository_import_worker.rb
index 2937493c614..fbc7ed63c6a 100644
--- a/app/workers/repository_import_worker.rb
+++ b/app/workers/repository_import_worker.rb
@@ -13,7 +13,7 @@ class RepositoryImportWorker
result = Projects::ImportService.new(project, current_user).execute
if result[:status] == :error
- project.update(import_error: result[:message])
+ project.update(import_error: Gitlab::UrlSanitizer.sanitize(result[:message]))
project.import_fail
return
end