This instance was upgraded to Heptapod 0.31.0 (final) today.

import_url_sanitizer.rb 413 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
module Gitlab
  class ImportUrlSanitizer
    def initialize(url)
      @url = URI.parse(url)
    end

    def sanitized_url
      @sanitized_url ||= safe_url.to_s
    end

    def credentials
      @credentials ||= { user: @url.user, password: @url.password }
    end

    private

    def safe_url
      safe_url = @url.dup
      safe_url.password = nil
      safe_url.user = nil
      safe_url
    end
  end
end