From 80fd5e47953c6d4ce8fafda3972084950802b5f7 Mon Sep 17 00:00:00 2001 From: sawadashota Date: Tue, 29 Mar 2022 21:37:08 +0900 Subject: [PATCH] fix: do not expose debug in a response when a schema is not found (#2348) Co-authored-by: hackerman <3372410+aeneasr@users.noreply.github.com> --- schema/handler.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/schema/handler.go b/schema/handler.go index c046563a3e52..da53eb0d0fa1 100644 --- a/schema/handler.go +++ b/schema/handler.go @@ -10,9 +10,10 @@ import ( "os" "strings" - "github.com/ory/kratos/driver/config" "github.com/ory/x/urlx" + "github.com/ory/kratos/driver/config" + "github.com/julienschmidt/httprouter" "github.com/pkg/errors" @@ -105,7 +106,7 @@ func (h *Handler) getByID(w http.ResponseWriter, r *http.Request, ps httprouter. s, err = ss.GetByID(id) if err != nil { - h.r.Writer().WriteError(w, r, errors.WithStack(herodot.ErrNotFound.WithDebugf("%+v", err))) + h.r.Writer().WriteError(w, r, errors.WithStack(herodot.ErrNotFound.WithReasonf("Identity schema `%s` could not be found.", id))) return } }