Skip to content

Commit

Permalink
fix: better comparison of encoded payloads for patch, fixes #73
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgtaylor committed Nov 3, 2023
1 parent 202c91e commit ac4573b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion autopatch/autopatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ func PatchResource(api huma.API, path *huma.PathItem) {
return
}

if bytes.Equal(bytes.TrimSpace(patched), bytes.TrimSpace(origWriter.Body.Bytes())) {
if jsonpatch.Equal(patched, origWriter.Body.Bytes()) {
ctx.SetStatus(http.StatusNotModified)
return
}
Expand Down

0 comments on commit ac4573b

Please sign in to comment.