mirror of
https://github.com/packwiz/packwiz.git
synced 2025-10-14 06:54:32 +02:00
Re-encode URLs from CF and when exporting to MR for RFC3986 compliance
This commit is contained in:
14
core/urlutil.go
Normal file
14
core/urlutil.go
Normal 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
|
||||
}
|
Reference in New Issue
Block a user