[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GET before PUT on an EditURI



On Tue, Jul 13, 2004 at 10:26:14PM -0400, Joe Gregorio wrote:
> 
> On Tue, 13 Jul 2004 15:26:51 -0700, Tim Bray <tim.bray@xxxxxxx> wrote:
> > [page 5/sect 3.2] the description reads like it's forbidden to do a PUT
> > without doing a GET first.  Is this true?  If I know the URI and I know
> > what I want to put there, can't I just blast it in?
> 
> You could, but you might not want to. 
> 
> Consider the case of a Wiki. Most Wiki HTML editing forms have 
> a nonce, either a hidden time or a hash value. This nonce is used
> to protect against edits being lost in a race condition, i.e. user
> A starts to edit a page, takes too long and later user B edits the
> same page and commits before user A does.
> 
> If the client does a GET on the EditURI then the server has a chance
> to place a nonce in the entry. The client should preserve
> that nonce and submit it with the entry when the edit entry
> is PUT back to the EditURI. 
> 
> For this scenario to work [...]

By "work", do you mean;

1. user A is notified of a problem when they try to PUT? ... or
2. user B is denied the ability to PUT because A is editing it?

If #1, I suggest that [1] would suffice to detect the conflict.
If #2, perhaps WebDAV LOCK should be considered.

But in both cases, a PUT without a preceding GET is not a problem.

 [1] http://www.w3.org/1999/04/Editing/

Mark.
-- 
Mark Baker.   Ottawa, Ontario, CANADA.        http://www.markbaker.ca

  Seeking work on large scale application/data integration projects
  and/or the enabling infrastructure for same.