fix(uri): hash tag is not properly handled in CrUri
This commit is contained in:
2
assets
2
assets
Submodule assets updated: 5e8e63b378...8e96f4d3de
@@ -344,11 +344,10 @@ func NewShareUri(id, password string) string {
|
|||||||
return fmt.Sprintf("%s://%s@%s", constants.CloudreveScheme, id, constants.FileSystemShare)
|
return fmt.Sprintf("%s://%s@%s", constants.CloudreveScheme, id, constants.FileSystemShare)
|
||||||
}
|
}
|
||||||
|
|
||||||
// PathEscape is same as url.PathEscape, with modifications to incoporate with JS encodeURI:
|
// PathEscape is same as url.PathEscape, with modifications to incoporate with JS encodeURIComponent:
|
||||||
// encodeURI() escapes all characters except:
|
// encodeURI() escapes all characters except:
|
||||||
//
|
//
|
||||||
// A–Z a–z 0–9 - _ . ! ~ * ' ( )
|
// A–Z a–z 0–9 - _ . ! ~ * ' ( )
|
||||||
// ; / ? : @ & = + $ , #
|
|
||||||
func PathEscape(s string) string {
|
func PathEscape(s string) string {
|
||||||
hexCount := 0
|
hexCount := 0
|
||||||
for i := 0; i < len(s); i++ {
|
for i := 0; i < len(s); i++ {
|
||||||
@@ -412,7 +411,7 @@ func shouldEscape(c byte) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch c {
|
switch c {
|
||||||
case '-', '_', '.', '~', '!', '*', '\'', '(', ')', ';', '/', '?', ':', '@', '&', '=', '+', '$', ',', '#': // §2.3 Unreserved characters (mark)
|
case '-', '_', '.', '~', '!', '*', '\'', '(', ')': // §2.3 Unreserved characters (mark)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user