fix: restrict remote pinning service endpoint URIs to HTTP/HTTPS
Adin Schmahmann committed
Jan 27, 2021 at 14:09 UTC
61f3a2f3a2e62b47f058029f77e95f9a11b38b4c
1 file changed
+1
-1
core/commands/pin/remotepin.go
+1
-1
@@ -740,7 +740,7 @@ func getRemotePinServiceInfo(env cmds.Environment, name string) (endpoint, key s
740
741
func normalizeEndpoint(endpoint string) (string, error) {
742
uri, err := neturl.ParseRequestURI(endpoint)
743
- if err != nil || !strings.HasPrefix(uri.Scheme, "http") {
743
+ if err != nil || !(uri.Scheme == "http" || uri.Scheme == "https") {
744
return "", fmt.Errorf("service endpoint must be a valid HTTP URL")
745
}
746