mirror of
https://github.com/pomerium/pomerium.git
synced 2025-07-16 00:06:31 +02:00
mcp: ignore unknown fields in the client registration request (#5643)
## Summary Some clients may send RFC7591 Client Registration Request with extra fields that are not part of the spec, and we used too restrictive decoder for that. This PR ignores the unknown fields. ## Related issues <!-- For example... - #159 --> ## User Explanation <!-- How would you explain this change to the user? If this change doesn't create any user-facing changes, you can leave this blank. If filled out, add the `docs` label --> ## Checklist - [ ] reference any related issues - [ ] updated unit tests - [ ] add appropriate label (`enhancement`, `bug`, `breaking`, `dependencies`, `ci`) - [ ] ready for review
This commit is contained in:
parent
37dc87b12f
commit
6e765abe2e
1 changed files with 1 additions and 1 deletions
|
@ -35,7 +35,7 @@ func (srv *Handler) RegisterClient(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
|
||||
v := new(rfc7591v1.ClientMetadata)
|
||||
err = protojson.Unmarshal(data, v)
|
||||
err = protojson.UnmarshalOptions{DiscardUnknown: true}.Unmarshal(data, v)
|
||||
if err != nil {
|
||||
log.Ctx(ctx).Error().Err(err).Msg("failed to unmarshal request body")
|
||||
http.Error(w, "failed to unmarshal request body", http.StatusBadRequest)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue