Skip to content
This repository was archived by the owner on Oct 20, 2024. It is now read-only.

Commit 77cca28

Browse files
committed
Move up removing the Debug from the error to before the JSON serialization
1 parent 694b161 commit 77cca28

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

webauthn/webauthn.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,16 @@ func (w *WebAuthn) writeErrorCode(r *http.Request, rw http.ResponseWriter, code
6161
code = http.StatusInternalServerError
6262
}
6363

64+
if !w.Config.Debug {
65+
e.Debug = ""
66+
}
67+
6468
js, err := json.Marshal(e)
6569
if err != nil {
6670
w.writeError(r, rw, err)
6771
return
6872
}
6973

70-
if !w.Config.Debug {
71-
e.Debug = ""
72-
}
73-
7474
rw.Header().Set("Content-Type", "application/json")
7575
rw.WriteHeader(code)
7676
rw.Write(js)

0 commit comments

Comments
 (0)