Skip to content

Commit 34c01a2

Browse files
committed
Align if-match * and if-none-match * with RFC9110
1 parent d598b13 commit 34c01a2

File tree

3 files changed

+20
-16
lines changed

3 files changed

+20
-16
lines changed

docs/odata-protocol/odata-protocol.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -926,19 +926,19 @@ <h3 id="823-header-accept-language"><a name="HeaderAcceptLanguage" href="#Header
926926
<details open><summary>
927927
<h3 id="824-header-if-match"><a name="HeaderIfMatch" href="#HeaderIfMatch">8.2.4 Header <code>If-Match</code></a></h3>
928928
</summary>
929-
<p>As defined in <a href="#rfc9110">RFC9110</a>, a client MAY include an <code>If-Match</code> header in a request to <code>GET</code>, <code>POST</code>, <code>PUT</code>, <code>PATCH</code> or <code>DELETE</code>. The value of the <code>If-Match</code> request header MUST be an ETag value previously retrieved for the resource, or <code>*</code> to match any value.</p>
930-
<p>If an operation on an existing resource requires an ETag, (see term <a href="https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Core.V1.md#OptimisticConcurrency"><code>Core.OptimisticConcurrency</code></a> in <a href="#ODataVocCore">OData-VocCore</a> and property <code>OptimisticConcurrencyControl</code> of type <a href="https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Capabilities.V1.md#NavigationPropertyRestriction"><code>Capabilities.NavigationPropertyRestriction</code></a> in <a href="#ODataVocCap">OData-VocCap</a>) and the client does not specify an <code>If-Match</code> request header in a <a href="#DataModification">Data Modification Request</a> or in an <a href="#Actions">Action Request</a> invoking an action bound to the resource, the service responds with a <code>428 Precondition Required</code> and MUST ensure that no observable change occurs as a result of the request.</p>
929+
<p>As defined in <a href="#rfc9110">RFC9110</a>, a client MAY include an <code>If-Match</code> header in a request to <code>GET</code>, <code>POST</code>, <code>PUT</code>, <code>PATCH</code> or <code>DELETE</code>. The value of the <code>If-Match</code> request header MUST be an ETag value previously retrieved for the resource, or <code>*</code>.</p>
930+
<p>If modification of an existing resource requires an ETag, (see term <a href="https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Core.V1.md#OptimisticConcurrency"><code>Core.OptimisticConcurrency</code></a> in <a href="#ODataVocCore">OData-VocCore</a> and property <code>OptimisticConcurrencyControl</code> of type <a href="https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Capabilities.V1.md#NavigationPropertyRestriction"><code>Capabilities.NavigationPropertyRestriction</code></a> in <a href="#ODataVocCap">OData-VocCap</a>) and the client does not specify an <code>If-Match</code> request header in a <a href="#DataModification">Data Modification Request</a> or in an <a href="#Actions">Action Request</a> invoking an action bound to the resource, the service responds with a <code>428 Precondition Required</code> and MUST ensure that no observable change occurs as a result of the request.</p>
931931
<p>If present, the request MUST only be processed if the specified ETag value matches the current ETag value of the target resource. Services sending <a href="#HeaderETag"><code>ETag</code></a> headers with weak ETags that only depend on the representation-independent entity state MUST use the weak comparison function because it is sufficient to prevent accidental overwrites. This is a deviation from <a href="#rfc9110">RFC9110</a>.</p>
932932
<p>If the value does not match the current ETag value of the resource for a <a href="#DataModification">Data Modification Request</a> or <a href="#Actions">Action Request</a>, the service MUST respond with <a href="#ResponseCode412PreconditionFailed"><code>412 Precondition Failed</code></a> and MUST ensure that no observable change occurs as a result of the request. In the case of an <a href="#UpsertanEntity">upsert</a>, if the addressed entity does not exist the provided ETag value is considered not to match.</p>
933-
<p>An <code>If-Match</code> header with a value of <code>*</code> in a <code>PUT</code> or <code>PATCH</code> request results in an <a href="#UpsertanEntity">upsert request</a> being processed as an update and not an insert.</p>
933+
<p>An <code>If-Match</code> header with a value of <code>*</code> matches any current representation of the resource, and in a <code>PUT</code> or <code>PATCH</code> request results in an <a href="#UpsertanEntity">upsert request</a> being processed as an <a href="#UpdateanEntity">update</a> and not an <a href="#CreateanEntity">insert</a>, independent of whether the resource requires an ETag.</p>
934934
<p>The <code>If-Match</code> header MUST NOT be specified on a batch request, but MAY be specified on individual requests within the batch.</p>
935935
</details>
936936
<details open><summary>
937937
<h3 id="825-header-if-none-match"><a name="HeaderIfNoneMatch" href="#HeaderIfNoneMatch">8.2.5 Header <code>If-None-Match</code></a></h3>
938938
</summary>
939939
<p>As defined in <a href="#rfc9110">RFC9110</a>, a client MAY include an <code>If-None-Match</code> header in a request to <code>GET</code>, <code>POST</code>, <code>PUT</code>, <code>PATCH</code> or <code>DELETE</code>. The value of the <code>If-None-Match</code> request header MUST be an ETag value previously retrieved for the resource, or <code>*</code>.</p>
940940
<p>If present, the request MUST only be processed if the specified ETag value does not match the current ETag value of the resource, using the weak comparison function (see <a href="#rfc9110">RFC9110</a>). If the value matches the current ETag value of the resource, then for a <code>GET</code> request, the service SHOULD respond with <a href="#ResponseCode304NotModified"><code>304 Not Modified</code></a>, and for a <a href="#DataModification">Data Modification Request</a> or <a href="#Actions">Action Request</a>, the service MUST respond with <a href="#ResponseCode412PreconditionFailed"><code>412 Precondition Failed</code></a> and MUST ensure that no observable change occurs as a result of the request.</p>
941-
<p>An <code>If-None-Match</code> header with a value of <code>*</code> in a <code>PUT</code> or <code>PATCH</code> request results in an <a href="#UpsertanEntity">upsert request</a> being processed as an <a href="#CreateanEntity">insert</a> and not an <a href="#UpdateanEntity">update</a>.</p>
941+
<p>An <code>If-None-Match</code> header with a value of <code>*</code> “matches” if there is no current representation of the resource, and in a <code>PUT</code> or <code>PATCH</code> request results in an <a href="#UpsertanEntity">upsert request</a> being processed as an <a href="#CreateanEntity">insert</a> and not an <a href="#UpdateanEntity">update</a>, independent of whether the resource requires an ETag.</p>
942942
<p>The <code>If-None-Match</code> header MUST NOT be specified on a batch request, but MAY be specified on individual requests within the batch.</p>
943943
</details>
944944
<details open><summary>

docs/odata-protocol/odata-protocol.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,9 +1061,9 @@ batch request.
10611061
As defined in [RFC9110](#rfc9110), a client MAY include an
10621062
`If-Match` header in a request to `GET`, `POST`, `PUT`, `PATCH` or
10631063
`DELETE`. The value of the `If-Match` request header MUST be an ETag
1064-
value previously retrieved for the resource, or `*` to match any value.
1064+
value previously retrieved for the resource, or `*`.
10651065

1066-
If an operation on an existing resource requires an ETag, (see term
1066+
If modification of an existing resource requires an ETag, (see term
10671067
[`Core.OptimisticConcurrency`](https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Core.V1.md#OptimisticConcurrency) in
10681068
[OData-VocCore](#ODataVocCore) and property
10691069
`OptimisticConcurrencyControl` of type
@@ -1090,9 +1090,10 @@ ensure that no observable change occurs as a result of the request. In
10901090
the case of an [upsert](#UpsertanEntity), if the addressed entity does
10911091
not exist the provided ETag value is considered not to match.
10921092

1093-
An `If-Match` header with a value of `*` in a `PUT` or `PATCH` request
1093+
An `If-Match` header with a value of `*` matches any current representation of the resource, and in a `PUT` or `PATCH` request
10941094
results in an [upsert request](#UpsertanEntity) being processed as an
1095-
update and not an insert.
1095+
[update](#UpdateanEntity) and not an [insert](#CreateanEntity),
1096+
independent of whether the resource requires an ETag.
10961097

10971098
The `If-Match` header MUST NOT be specified on a batch request, but MAY
10981099
be specified on individual requests within the batch.
@@ -1115,9 +1116,10 @@ the service MUST respond with
11151116
[`412 Precondition Failed`](#ResponseCode412PreconditionFailed) and MUST
11161117
ensure that no observable change occurs as a result of the request.
11171118

1118-
An `If-None-Match` header with a value of `*` in a `PUT` or `PATCH`
1119+
An `If-None-Match` header with a value of `*` "matches" if there is no current representation of the resource, and in a `PUT` or `PATCH`
11191120
request results in an [upsert request](#UpsertanEntity) being processed
1120-
as an [insert](#CreateanEntity) and not an [update](#UpdateanEntity).
1121+
as an [insert](#CreateanEntity) and not an [update](#UpdateanEntity),
1122+
independent of whether the resource requires an ETag.
11211123

11221124
The `If-None-Match` header MUST NOT be specified on a batch request, but
11231125
MAY be specified on individual requests within the batch.

odata-protocol/8 Header Fields.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,9 @@ batch request.
164164
As defined in [RFC9110](#rfc9110), a client MAY include an
165165
`If-Match` header in a request to `GET`, `POST`, `PUT`, `PATCH` or
166166
`DELETE`. The value of the `If-Match` request header MUST be an ETag
167-
value previously retrieved for the resource, or `*` to match any value.
167+
value previously retrieved for the resource, or `*`.
168168

169-
If an operation on an existing resource requires an ETag, (see term
169+
If modification of an existing resource requires an ETag, (see term
170170
[`Core.OptimisticConcurrency`](https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Core.V1.md#OptimisticConcurrency) in
171171
[OData-VocCore](#ODataVocCore) and property
172172
`OptimisticConcurrencyControl` of type
@@ -193,9 +193,10 @@ ensure that no observable change occurs as a result of the request. In
193193
the case of an [upsert](#UpsertanEntity), if the addressed entity does
194194
not exist the provided ETag value is considered not to match.
195195

196-
An `If-Match` header with a value of `*` in a `PUT` or `PATCH` request
196+
An `If-Match` header with a value of `*` matches any current representation of the resource, and in a `PUT` or `PATCH` request
197197
results in an [upsert request](#UpsertanEntity) being processed as an
198-
update and not an insert.
198+
[update](#UpdateanEntity) and not an [insert](#CreateanEntity),
199+
independent of whether the resource requires an ETag.
199200

200201
The `If-Match` header MUST NOT be specified on a batch request, but MAY
201202
be specified on individual requests within the batch.
@@ -218,9 +219,10 @@ the service MUST respond with
218219
[`412 Precondition Failed`](#ResponseCode412PreconditionFailed) and MUST
219220
ensure that no observable change occurs as a result of the request.
220221

221-
An `If-None-Match` header with a value of `*` in a `PUT` or `PATCH`
222+
An `If-None-Match` header with a value of `*` "matches" if there is no current representation of the resource, and in a `PUT` or `PATCH`
222223
request results in an [upsert request](#UpsertanEntity) being processed
223-
as an [insert](#CreateanEntity) and not an [update](#UpdateanEntity).
224+
as an [insert](#CreateanEntity) and not an [update](#UpdateanEntity),
225+
independent of whether the resource requires an ETag.
224226

225227
The `If-None-Match` header MUST NOT be specified on a batch request, but
226228
MAY be specified on individual requests within the batch.

0 commit comments

Comments
 (0)