Grzegorz Kossakowski wrote:
Daniel Fagerstrom napisaĆ(a):
Exactly, an implicit, automatic HTTP HEAD handling would work for
sitemap rules that are idempotent (i.e. calling any number of times
gives the same result as calling once, which GET is supposed to be
even if that not always is the case). But for any sitemap with actions
or flowscripts it would typically not work.
One could have automatic HTTP HEAD handling anyway, and combining it
with explicit sitemap (or flowscript rules) for HEAD handling in those
cases where it is needed. But this of course leaves a lot of
possibilities for mistakes for the users.
Right. I think our problem is because we used to treat lightly a HTTP
spec (for example not properly working conditional gets).
What options do we have? Personally, I see only one:
Implement automatic HTTP HEAD handling for simple pipelines that do not
contain act/flow calls and evangelize users to produce code (components)
properly handling HEAD requests.
So its matter of really good docs and fat warnings.
IMHO, Cocoon *should* handle *external* HTTP HEAD requests automatically --
build a pipeline, but not execute it -- and do it for all types of sitemap,
including those which have actions or flowscripts -- so that application writer
can explicitly handle these cases, as Daniel said above. Yes, documentation and
warnings would be nice.
But, I am not so sure that this same mechanism should be reused in the context
of this service machinery -- some other option discussed earlier in this thread
is IMHO more appropriate here, be it passing some environment or call stack or
whatever is required (yep, you can tell I was not following this thread too
closely ;-)
For some reason I do have an expectation that "service" would work seamlessly
with any sort of sitemap, passing in data from original request unchanged.
Imagine for a second that the sitemap you are calling *is* aware of the HTTP
method, and its response depends on the method. In this case, if you change
request method -- say original method was PROPSET or LOCK -- and use HEAD
instead of LOCK, the sitemap you are calling could give completely unexpected
result (e.g. error page :).
Vadim