Skip to content

Commit 18df1b5

Browse files
committed
Update errorpage handling
1 parent 5c38a70 commit 18df1b5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

apps/internal/local/server.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,10 @@ func (s *Server) handler(w http.ResponseWriter, r *http.Request) {
169169

170170
errDesc := q.Get("error_description")
171171

172-
s.errorPage = bytes.ReplaceAll(s.errorPage, code, []byte(html.EscapeString(headerErr))) // provides XSS protection
173-
s.errorPage = bytes.ReplaceAll(s.errorPage, err, []byte(html.EscapeString(errDesc))) // provides XSS protection
172+
errorPage := bytes.ReplaceAll(s.errorPage, code, []byte(html.EscapeString(headerErr))) // provides XSS protection
173+
errorPage = bytes.ReplaceAll(errorPage, err, []byte(html.EscapeString(errDesc))) // provides XSS protection
174174

175-
_, _ = w.Write(s.errorPage)
175+
_, _ = w.Write(errorPage)
176176

177177
errorDesc := fmt.Errorf(errDesc)
178178
s.putResult(Result{Err: errorDesc})

0 commit comments

Comments
 (0)