Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modification with new if-equal: skip header returns wrong HTTP status code #1690

Closed
thjaeckle opened this issue Jul 13, 2023 · 0 comments · Fixed by #1696
Closed

Modification with new if-equal: skip header returns wrong HTTP status code #1690

thjaeckle opened this issue Jul 13, 2023 · 0 comments · Fixed by #1696
Assignees
Labels
Milestone

Comments

@thjaeckle
Copy link
Member

I just noticed that when:

  • modifying a thing and setting the (in Ditto 3.3.0 added) header if-equal: skip
  • the HTTP status code if the outcome would be equal to the provided value
    • is: 304 (Not Modified)
    • this status code is however is only allowed to be returned for "safe" methods like GET and HEAD
    • instead we must return (same as for the If-Match headers) a 412 (Precondition failed)

This is a bug and should be fixed as part of Ditto 3.3

@thjaeckle thjaeckle added the bug label Jul 13, 2023
@thjaeckle thjaeckle added this to the 3.3.5 milestone Jul 13, 2023
@thjaeckle thjaeckle changed the title Modification with new if-equal: skip header returns wrong HTTP status response Modification with new if-equal: skip header returns wrong HTTP status code Jul 13, 2023
thjaeckle added a commit that referenced this issue Jul 17, 2023
Signed-off-by: Thomas Jäckle <thomas.jaeckle@beyonnex.io>
@thjaeckle thjaeckle self-assigned this Jul 18, 2023
thjaeckle added a commit that referenced this issue Jul 21, 2023
…tp-status-code

#1690 use correct HTTP status code for "if-equal": skip on equality
thjaeckle added a commit that referenced this issue Jul 21, 2023
Signed-off-by: Thomas Jäckle <thomas.jaeckle@beyonnex.io>
(cherry picked from commit ec71965)
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant