This repository was archived by the owner on Sep 11, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -128,10 +128,10 @@ func (u *Endpoint) String() string {
128
128
buf .WriteString ("//" )
129
129
130
130
if u .User != "" || u .Password != "" {
131
- buf .WriteString (u .User )
131
+ buf .WriteString (url . PathEscape ( u .User ) )
132
132
if u .Password != "" {
133
133
buf .WriteByte (':' )
134
- buf .WriteString (u .Password )
134
+ buf .WriteString (url . PathEscape ( u .Password ) )
135
135
}
136
136
137
137
buf .WriteByte ('@' )
Original file line number Diff line number Diff line change 1
1
package transport
2
2
3
3
import (
4
+ "net/url"
4
5
"testing"
5
6
6
7
"gopkg.in/src-d/go-git.v4/plumbing/protocol/packp/capability"
@@ -153,6 +154,15 @@ func (s *SuiteCommon) TestNewEndpointFileURL(c *C) {
153
154
c .Assert (e .String (), Equals , "file:///foo.git" )
154
155
}
155
156
157
+ func (s * SuiteCommon ) TestValidEndpoint (c * C ) {
158
+ e , err := NewEndpoint ("http://github.com/user/repository.git" )
159
+
160
+ e .Password = " !\" #$%&'()*+,-./:;<=>?@[\\ ]^_`{|}~"
161
+ url , err := url .Parse (e .String ())
162
+ c .Assert (err , IsNil )
163
+ c .Assert (url , NotNil )
164
+ }
165
+
156
166
func (s * SuiteCommon ) TestNewEndpointInvalidURL (c * C ) {
157
167
e , err := NewEndpoint ("http://\\ " )
158
168
c .Assert (err , NotNil )
You can’t perform that action at this time.
0 commit comments