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 <3372410+aeneasr@users.noreply.github.com>
  • Loading branch information
sawadashota and aeneasr committed 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.