From 21a4a94114743ab5d55427c8bcb0d40c79ba1c84 Mon Sep 17 00:00:00 2001 From: Adrien Castex Date: Sat, 15 Jul 2017 15:57:30 +0200 Subject: [PATCH] Fixed the 'LOCK' method which needed the 'owner' in the lock properties (which was made optional in the past) --- lib/server/commands/Lock.js | 3 ++- lib/server/v2/commands/Lock.js | 3 ++- src/server/commands/Lock.ts | 3 ++- src/server/v2/commands/Lock.ts | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/server/commands/Lock.js b/lib/server/commands/Lock.js index 2e123fe0..96d75b97 100644 --- a/lib/server/commands/Lock.js +++ b/lib/server/commands/Lock.js @@ -20,7 +20,8 @@ function createResponse(arg, lock) { activelock.ele('D:locktoken').ele('D:href', undefined, true).add(lock.uuid); activelock.ele('D:lockroot').add(arg.fullUri()); activelock.ele('D:depth').add('infinity'); - activelock.ele('D:owner').add(lock.owner); + if (lock.owner) + activelock.ele('D:owner').add(lock.owner); activelock.ele('D:timeout').add('Second-' + lock.lockKind.timeout); return prop; } diff --git a/lib/server/v2/commands/Lock.js b/lib/server/v2/commands/Lock.js index 68476be8..9bc54e88 100644 --- a/lib/server/v2/commands/Lock.js +++ b/lib/server/v2/commands/Lock.js @@ -19,7 +19,8 @@ function createResponse(ctx, lock) { activelock.ele('D:locktoken').ele('D:href', undefined, true).add(lock.uuid); activelock.ele('D:lockroot').ele('D:href', undefined, true).add(encodeURI(ctx.fullUri())); activelock.ele('D:depth').add(lock.depth === -1 ? 'infinity' : lock.depth.toString()); - activelock.ele('D:owner').add(lock.owner); + if (lock.owner) + activelock.ele('D:owner').add(lock.owner); activelock.ele('D:timeout').add('Second-' + lock.lockKind.timeout); return prop; } diff --git a/src/server/commands/Lock.ts b/src/server/commands/Lock.ts index 34beb336..b31e78f8 100644 --- a/src/server/commands/Lock.ts +++ b/src/server/commands/Lock.ts @@ -21,7 +21,8 @@ function createResponse(arg : MethodCallArgs, lock : Lock) activelock.ele('D:locktoken').ele('D:href', undefined, true).add(lock.uuid); activelock.ele('D:lockroot').add(arg.fullUri()); activelock.ele('D:depth').add('infinity'); - activelock.ele('D:owner').add(lock.owner); + if(lock.owner) + activelock.ele('D:owner').add(lock.owner); activelock.ele('D:timeout').add('Second-' + lock.lockKind.timeout); return prop; diff --git a/src/server/v2/commands/Lock.ts b/src/server/v2/commands/Lock.ts index d183a1b8..2477611e 100644 --- a/src/server/v2/commands/Lock.ts +++ b/src/server/v2/commands/Lock.ts @@ -23,7 +23,8 @@ function createResponse(ctx : HTTPRequestContext, lock : Lock) activelock.ele('D:locktoken').ele('D:href', undefined, true).add(lock.uuid); activelock.ele('D:lockroot').ele('D:href', undefined, true).add(encodeURI(ctx.fullUri())); activelock.ele('D:depth').add(lock.depth === -1 ? 'infinity' : lock.depth.toString()); - activelock.ele('D:owner').add(lock.owner); + if(lock.owner) + activelock.ele('D:owner').add(lock.owner); activelock.ele('D:timeout').add('Second-' + lock.lockKind.timeout); return prop;