Skip to content

Commit

Permalink
fix: do not expose debug in a response when a schema is not found (#2348
Browse files Browse the repository at this point in the history
)

Co-authored-by: hackerman <[email protected]>
  • Loading branch information
sawadashota and aeneasr authored Mar 29, 2022
1 parent b85c0e6 commit aee2b1e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions schema/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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
}
}
Expand Down

0 comments on commit aee2b1e

Please sign in to comment.