Shouldn't the PUT API requests respect the "If-Unmodified-Since" header?

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

A sample workflow

  1. Make a GET request on a resource, an Issue for example
  2. Do some data manipulation and calculate something
  3. Make a PUT request on the same resource, trying to set some attributes
Question

How can I be sure that my PUT request, on step #3, will not "clobber" a resource attribute that was set by another user while I was doing my calculations while in step #2?

Expected behavior

I would expect that the updated_at timestamp from the resource I GET, from step #1, if used as a If-Unmodified-Since header (with the timestamp,properly formatted) in the PUT request, in step #3 would result in a 403 (maybe?) if the resource has been modified sometime between step #1 and #3

In my example (in the current hosted version of Gitlab) passing a header with a ridiculously old date If-Unmodified-Since: Sat, 29 Oct 1994 19:43:31 GMT while doing a PUT API call on an existing Issue, results in 200 OK status and my Issue being updated.

Edited by 🤖 GitLab Bot 🤖