Re-encode URLs from CF and when exporting to MR for RFC3986 compliance

This commit is contained in:
comp500
2022-02-14 15:48:54 +00:00
parent fa5de4b4bc
commit 36b6d806c8
3 changed files with 34 additions and 3 deletions

14
core/urlutil.go Normal file
View File

@@ -0,0 +1,14 @@
package core
import (
"fmt"
"net/url"
)
func ReencodeURL(u string) (string, error) {
parsed, err := url.Parse(u)
if err != nil {
return "", fmt.Errorf("failed to parse url: %s, %v", u, err)
}
return parsed.String(), nil
}