W3C home > Mailing lists > Public > ietf-http-wg@w3.org > July to September 2012

#372: refactor conditional header field descriptions

From: Julian Reschke <julian.reschke@gmx.de>
Date: Tue, 10 Jul 2012 22:17:52 +0200
Message-ID: <4FFC8DF0.1050803@gmx.de>
To: HTTP Working Group <ietf-http-wg@w3.org>
(see http://trac.tools.ietf.org/wg/httpbis/trac/ticket/372)

While looking at If-Match and If-None-Match I realized that there's a 
lot of prose we repeat, and then sometimes do not get it right.

I'd like to refactor these so that the condition is only defined once.

Proposal for If-Match:

diff -r19.43 draft-ietf-httpbis-p4-conditional-latest.unpg.txt
630,640c630,641
<  If any of the entity-tags listed in the If-Match field value match
<  (as per Section 2.3.2) the entity-tag of the selected representation
<  for the target resource, or if "*" is given and any current
<  representation exists for the target resource, then the server MAY
<  perform the request method as if the If-Match header field was not
<  present.
<
<  Origin servers MUST NOT perform the requested method if none of the
<  entity-tags match, or if "*" is given and no current representation
<  exists; instead they MUST respond with the 412 (Precondition Failed)
<  status code.
---
 >  The If-Match condition is met if and only if any of the entity-tags
 >  listed in the If-Match field value match (as per Section 2.3.2) the
 >  entity-tag of the selected representation for the target resource, or
 >  if "*" is given and any current representation exists for the target
 >  resource.
 >
 >  If the condition is met, the server MAY perform the request method as
 >  if the If-Match header field was not present.
 >
 >  Origin servers MUST NOT perform the requested method if the condition
 >  is not met; instead they MUST respond with the 412 (Precondition
 >  Failed) status code.
643,644c644
<  MUST NOT perform the requested method if none of the entity-tags
<  match, or if "*" is given and no current representation exists;
---
 >  MUST NOT perform the requested method if the condition is not met;

and for If-None-Match:

<  If any of the entity-tags listed in the If-None-Match field-value
<  match (as per Section 2.3.2) the entity-tag of the selected
<  representation, or if "*" is given and any current representation
<  exists for that resource, then the server MUST NOT perform the
<  requested method.  Instead, if the request method was GET or HEAD,
<  the server SHOULD respond with a 304 (Not Modified) status code,
<  including the cache-related header fields (particularly ETag) of the
<  selected representation that has a matching entity-tag.  For all
<  other request methods, the server MUST respond with a 412
<  (Precondition Failed) status code.
<
<  If none of the entity-tags match, then the server MAY perform the
<  requested method as if the If-None-Match header field did not exist,
<  but MUST also ignore any If-Modified-Since header field(s) in the
<  request.  That is, if no entity-tags match, then the server MUST NOT
<  return a 304 (Not Modified) response.
---
 >  The If-None-Match condition is met if and only if any of the entity-
 >  tags listed in the If-None-Match field-value match (as per
 >  Section 2.3.2) the entity-tag of the selected representation, or if
 >  "*" is given and any current representation exists for that resource.
 >
 >  If the condition is met, the server MUST NOT perform the requested
 >  method.  Instead, if the request method was GET or HEAD, the server
 >  SHOULD respond with a 304 (Not Modified) status code, including the
 >  cache-related header fields (particularly ETag) of the selected
 >  representation that has a matching entity-tag.  For all other request
 >  methods, the server MUST respond with a 412 (Precondition Failed)
 >  status code.
 >
 >  If the condition is not met, the server MAY perform the requested
 >  method as if the If-None-Match header field did not exist, but MUST
 >  also ignore any If-Modified-Since header field(s) in the request.
 >  That is, if no entity-tags match, then the server MUST NOT return a
 >  304 (Not Modified) response.

(See 
<http://trac.tools.ietf.org/wg/httpbis/trac/attachment/ticket/372/372.diff>)

Feedback appreciated,

Julian
Received on Tuesday, 10 July 2012 20:18:29 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 10 July 2012 20:18:35 GMT