Skip to content

Commit 37c70e2

Browse files
flavianmissibgavrilMS
authored andcommitted
apps/internal/local: html escape error desc query string
1 parent 36ff880 commit 37c70e2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

apps/internal/local/server.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ package local
77
import (
88
"context"
99
"fmt"
10+
"html"
1011
"net"
1112
"net/http"
1213
"strconv"
@@ -141,7 +142,7 @@ func (s *Server) handler(w http.ResponseWriter, r *http.Request) {
141142

142143
headerErr := q.Get("error")
143144
if headerErr != "" {
144-
desc := q.Get("error_description")
145+
desc := html.EscapeString(q.Get("error_description"))
145146
// Note: It is a little weird we handle some errors by not going to the failPage. If they all should,
146147
// change this to s.error() and make s.error() write the failPage instead of an error code.
147148
_, _ = w.Write([]byte(fmt.Sprintf(failPage, headerErr, desc)))

0 commit comments

Comments
 (0)