Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
e27dc776
Commit
e27dc776
authored
Sep 08, 2017
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix problems with Gitlab::UrlSanitizer
parent
6e31e1b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
lib/gitlab/url_sanitizer.rb
lib/gitlab/url_sanitizer.rb
+7
-7
No files found.
lib/gitlab/url_sanitizer.rb
View file @
e27dc776
...
...
@@ -49,20 +49,20 @@ module Gitlab
private
def
parse_url
(
url
)
url
=
url
.
strip
match
=
url
.
match
(
%r{
\A
(?:ssh|http(?:s?))
\:
//(?:(.+)(?:@))?(.+)}
)
url
=
url
.
to_s
.
strip
match
=
url
.
match
(
%r{
\A
(?:
git|
ssh|http(?:s?))
\:
//(?:(.+)(?:@))?(.+)}
)
raw_credentials
=
match
[
1
]
if
match
if
raw_credentials
.
present?
url
.
sub!
(
"
#{
raw_credentials
}
@"
,
''
)
user
,
password
=
raw_credentials
.
split
(
':'
)
@credentials
||=
{
user:
user
,
password:
password
}
@credentials
||=
{
user:
user
.
presence
,
password:
password
.
presence
}
end
url
=
Addressable
::
URI
.
parse
(
url
)
url
.
user
=
user
url
.
password
=
password
url
.
password
=
password
if
password
.
present?
url
.
user
=
user
if
user
.
present?
url
end
...
...
@@ -70,8 +70,8 @@ module Gitlab
return
@url
unless
valid_credentials?
@full_url
=
@url
.
dup
@full_url
.
password
=
credentials
[
:password
]
@full_url
.
user
=
credentials
[
:user
]
@full_url
.
password
=
credentials
[
:password
]
if
credentials
[
:password
].
present?
@full_url
.
user
=
credentials
[
:user
]
if
credentials
[
:user
].
present?
@full_url
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment