Skip to content

Commit 041d4f8

Browse files
committed
Revert failPage change, to be of type const string
1 parent 6a36074 commit 041d4f8

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
@@ -28,7 +28,7 @@ var okPage = []byte(`
2828
</html>
2929
`)
3030

31-
var failPage = []byte(`
31+
const failPage = `
3232
<!DOCTYPE html>
3333
<html>
3434
<head>
@@ -40,7 +40,7 @@ var failPage = []byte(`
4040
<p>Error details: error %s error_description: %s</p>
4141
</body>
4242
</html>
43-
`)
43+
`
4444

4545
// Result is the result from the redirect.
4646
type Result struct {
@@ -153,7 +153,7 @@ func (s *Server) handler(w http.ResponseWriter, r *http.Request) {
153153
desc := html.EscapeString(q.Get("error_description"))
154154
// Note: It is a little weird we handle some errors by not going to the failPage. If they all should,
155155
// change this to s.error() and make s.error() write the failPage instead of an error code.
156-
_, _ = w.Write([]byte(fmt.Sprintf(string(failPage), headerErr, desc)))
156+
_, _ = w.Write([]byte(fmt.Sprintf(failPage, headerErr, desc)))
157157
s.putResult(Result{Err: fmt.Errorf(desc)})
158158
return
159159
}

0 commit comments

Comments
 (0)