Reputation: 1
According to the documentation:
"An optional header specifying a date and time. The request returns records that have been modified after that date and time."
I am making a request to the following endpoint:
/services/data/v55.0/sobjects/Contact/{id}
With the following headers:
GET
Content-Type: "application/json" Authorization: "Bearer {access_token}" "If-Modified-Since": Thu, 08 Sep 2022 16:54:10 GMT
The header of the response contains the "Last-Modified" date/time of the SObject row that I requested and the date is "Thu, 08 Sep 2022 15:54:10 GMT".
How is it possible that the api is returning the data of the contact if it has not been modified since the time in my request?
Note: When I change the date/time in my request to "Thu, 08 Sep 2022 15:54:11 GMT", I see the correct behaviour and a 304 Not Modified is returned. However, should the time be moved forward by an hour the data is returned with a 200 OK
Upvotes: 0
Views: 376
Reputation: 26139
This can be a bug in the server implementation.
Another explanation that the server time is not properly set. Looks like in the case of salesforce this is true. A possible workaround is strictly using the value they send in the Last-Modified header instead of the current time of the client's computer. https://salesforce.stackexchange.com/a/375976
Upvotes: 0