[PATCH] Follow RFC-7232 while evaluating the precedence of conditional headers

Karthik Uthaman karthik.uthamann at gmail.com
Fri May 1 22:05:05 UTC 2020


Nginx evaluates the conditional headers in the following order
if_unmodified_since
if_match
if_modified_since
if_none_match

which ignores some of the subtleties mentioned in RFC-7232, which
gives more precedence to etag based validation over time.

https://tools.ietf.org/html/rfc7232#section-3.4
A recipient MUST ignore If-Unmodified-Since if the request contains
an If-Match header field; the condition in If-Match is considered to
be a more accurate replacement for the condition in
If-Unmodified-Since, and the two are only combined for the sake of
interoperating with older intermediaries that might not implement
If-Match.

https://tools.ietf.org/html/rfc7232#section-3.3 and
A recipient MUST ignore If-Modified-Since if the request contains an
If-None-Match header field; the condition in If-None-Match is
considered to be a more accurate replacement for the condition in
If-Modified-Since, and the two are only combined for the sake of
interoperating with older intermediaries that might not implement
If-None-Match.

Along with those I have followed the precedence guidance provided in
https://tools.ietf.org/html/rfc7232#section-6 to change the order of
conditional headers being evaluated in nginx.

Please let me know if the changes in the patch file looks good. Happy to
address any concerns you may have.

- Karthik Uthaman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20200501/84787137/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nginx.patch
Type: application/octet-stream
Size: 3387 bytes
Desc: not available
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20200501/84787137/attachment.obj>


More information about the nginx-devel mailing list