Hello again,
--- Alex Rousskov <rousskov@...> wrote:
> The logic behind all If-* headers is not that complex after you
> digest RFC wording into something more systematic/algorithmic
> (which may take days).
Well, it took me a little longer than days :)
(Actually, I just hadn't had time to work on it over the summer.)
I think I have come up with an absolutely minimal logic for an
origin server reacting to If-* headers that remains conditionally
compliant with RFC 2616, but I would appreciate a sanity check.
The pseudocode is:
if If-Match is present and it is not "*"
respond with 412 Precondition Failed
if If-None-Match is "*"
begin
if the request method is neither "GET" nor "HEAD"
respond with 412 Precondition Failed
if neither If-Modified-Since nor If-Unmodified-Since is present
respond with 501 Not Implemented
end
otherwise respond with the requested resource
I fully admit that the primary goal is for the code to be
minimal; specifically, I don't want to have code to parse
the date, and I want the set of possible responses to be as
small as possible. I realize the 501 Not Implemented is a
bit "rude", but it doesn't appear to be in violation of
RFC 2616; the important part seems to be that I MUST NOT
serve the requested resource if If-None-Match matches
(i.e. in my ETag-less case, if it'd "*") in the absence of
If-[Un]modified-Since headers.
Unless I have missed something?
Thanks in advance for any help.
-Chris
______________________________________________________________________
Post your free ad now! http://personals.yahoo.ca