"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/net/url/url.go" between
go1.19.src.tar.gz and go1.19.1.src.tar.gz

About: Google’s Go is a compiled, garbage-collected, concurrent programming language.
Latest stable release (1.19).

url.go  (go1.19.src):url.go  (go1.19.1.src)
skipping to change at line 1194 skipping to change at line 1194
return err return err
} }
*u = *u1 *u = *u1
return nil return nil
} }
// JoinPath returns a new URL with the provided path elements joined to // JoinPath returns a new URL with the provided path elements joined to
// any existing path and the resulting path cleaned of any ./ or ../ elements. // any existing path and the resulting path cleaned of any ./ or ../ elements.
// Any sequences of multiple / characters will be reduced to a single /. // Any sequences of multiple / characters will be reduced to a single /.
func (u *URL) JoinPath(elem ...string) *URL { func (u *URL) JoinPath(elem ...string) *URL {
url := *u elem = append([]string{u.EscapedPath()}, elem...)
if len(elem) > 0 { var p string
elem = append([]string{u.EscapedPath()}, elem...) if !strings.HasPrefix(elem[0], "/") {
p := path.Join(elem...) // Return a relative path if u is relative,
// path.Join will remove any trailing slashes. // but ensure that it contains no ../ elements.
// Preserve at least one. elem[0] = "/" + elem[0]
if strings.HasSuffix(elem[len(elem)-1], "/") && !strings.HasSuffi p = path.Join(elem...)[1:]
x(p, "/") { } else {
p += "/" p = path.Join(elem...)
} }
url.setPath(p) // path.Join will remove any trailing slashes.
// Preserve at least one.
if strings.HasSuffix(elem[len(elem)-1], "/") && !strings.HasSuffix(p, "/"
) {
p += "/"
} }
url := *u
url.setPath(p)
return &url return &url
} }
// validUserinfo reports whether s is a valid userinfo string per RFC 3986 // validUserinfo reports whether s is a valid userinfo string per RFC 3986
// Section 3.2.1: // Section 3.2.1:
// //
// userinfo = *( unreserved / pct-encoded / sub-delims / ":" ) // userinfo = *( unreserved / pct-encoded / sub-delims / ":" )
// unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" // unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
// sub-delims = "!" / "$" / "&" / "'" / "(" / ")" // sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
// / "*" / "+" / "," / ";" / "=" // / "*" / "+" / "," / ";" / "="
 End of changes. 2 change blocks. 
11 lines changed or deleted 17 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)