mirror of
https://github.com/pikami/cosmium.git
synced 2026-11-01 05:55:36 +00:00
Expose precondition error code header
Co-authored-by: Pijus Kamandulis <[email protected]>
This commit is contained in:
1 parent
97dc9fb465
commit
2f1cfd7069
3 files changed
+3
-1
No files matched your search
@@ -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
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user