From 2e0041f95fc774f8129ebe008aacd83fc46b2dd9 Mon Sep 17 00:00:00 2001
From: Bob Callaway <bob.callaway@gmail.com>
Date: Wed, 6 Oct 2021 10:16:55 -0400
Subject: [PATCH] ensure template does not double-escape URL

Signed-off-by: Bob Callaway <bob.callaway@gmail.com>
---
 server/handlers.go  | 3 ++-
 server/templates.go | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/server/handlers.go b/server/handlers.go
index bf7f8e07..bb15d692 100644
--- a/server/handlers.go
+++ b/server/handlers.go
@@ -6,6 +6,7 @@ import (
 	"encoding/base64"
 	"encoding/json"
 	"fmt"
+	"html/template"
 	"net/http"
 	"net/url"
 	"path"
@@ -174,7 +175,7 @@ func (s *Server) handleAuthorization(w http.ResponseWriter, r *http.Request) {
 			ID:   conn.ID,
 			Name: conn.Name,
 			Type: conn.Type,
-			URL:  connURL.String(),
+			URL:  template.URL(connURL.String()),
 		}
 	}
 
diff --git a/server/templates.go b/server/templates.go
index e46855b1..0307437c 100644
--- a/server/templates.go
+++ b/server/templates.go
@@ -244,7 +244,7 @@ var scopeDescriptions = map[string]string{
 type connectorInfo struct {
 	ID   string
 	Name string
-	URL  string
+	URL  template.URL
 	Type string
 }
 
-- 
GitLab