Expose precondition error code header

Co-authored-by: Pijus Kamandulis <pikami@users.noreply.github.com>
This commit is contained in:
Cursor Agent
2026-06-05 20:14:46 +00:00
parent 97dc9fb465
commit 2f1cfd7069
3 changed files with 3 additions and 1 deletions
+1
View File
@@ -105,6 +105,7 @@ func (h *Handlers) ReplaceDocument(c *gin.Context) {
if ifMatch := c.GetHeader(headers.IfMatch); ifMatch != "" {
if existingDocument["_etag"] != ifMatch {
c.Header(headers.ErrorCode, "PreconditionFailed")
c.JSON(http.StatusPreconditionFailed, constants.PreconditionFailedResponse)
return
}