From 61f3a2f3a2e62b47f058029f77e95f9a11b38b4c Mon Sep 17 00:00:00 2001 From: Adin Schmahmann Date: Wed, 27 Jan 2021 14:09:29 -0500 Subject: [PATCH] fix: restrict remote pinning service endpoint URIs to HTTP/HTTPS --- core/commands/pin/remotepin.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/commands/pin/remotepin.go b/core/commands/pin/remotepin.go index 80572bfb8..606b23f6d 100644 --- a/core/commands/pin/remotepin.go +++ b/core/commands/pin/remotepin.go @@ -740,7 +740,7 @@ func getRemotePinServiceInfo(env cmds.Environment, name string) (endpoint, key s func normalizeEndpoint(endpoint string) (string, error) { uri, err := neturl.ParseRequestURI(endpoint) - if err != nil || !strings.HasPrefix(uri.Scheme, "http") { + if err != nil || !(uri.Scheme == "http" || uri.Scheme == "https") { return "", fmt.Errorf("service endpoint must be a valid HTTP URL") } -- GitLab