@@ -36,8 +36,8 @@ module.exports = (test, options, index) => test('unlock', (isValid, server) =>
36
36
return ;
37
37
}
38
38
39
- const lock = body . substr ( body . indexOf ( '<D:locktoken><D:href>' ) + '<D:locktoken><D:href>' . length , 'urn:uuid:24fa520c-520c-14fa-00d6-0000d546f655' . length ) ;
40
-
39
+ const lock = body . substring ( body . indexOf ( '<D:locktoken><D:href>' ) + '<D:locktoken><D:href>' . length , body . indexOf ( '</D:href>' , body . indexOf ( '<D:locktoken><D:href>' ) ) ) ;
40
+ console . log ( lock ) ;
41
41
request ( {
42
42
url : url + '/test.txt' ,
43
43
method : 'UNLOCK' ,
@@ -89,7 +89,7 @@ module.exports = (test, options, index) => test('unlock', (isValid, server) =>
89
89
} ,
90
90
body : '<?xml version="1.0" encoding="utf-8" ?><D:lockinfo xmlns:D="DAV:"><D:lockscope><D:exclusive/></D:lockscope><D:locktype><D:write/></D:locktype><D:owner><D:href>' + url + '/user</D:href></D:owner></D:lockinfo>'
91
91
} , ( e , res , body ) => _ ( e , ( ) => {
92
- const lock = body . substr ( body . indexOf ( '<D:locktoken><D:href>' ) + '<D:locktoken><D:href>' . length , 'urn:uuid:24fa520c-520c-14fa-00d6-0000d546f655' . length ) ;
92
+ const lock = body . substring ( body . indexOf ( '<D:locktoken><D:href>' ) + '<D:locktoken><D:href>' . length , body . indexOf ( '</D:href>' , body . indexOf ( '<D:locktoken><D:href>' ) ) ) ;
93
93
94
94
request ( {
95
95
url : url + '/test3.txt' ,
@@ -136,7 +136,7 @@ module.exports = (test, options, index) => test('unlock', (isValid, server) =>
136
136
} ,
137
137
body : '<?xml version="1.0" encoding="utf-8" ?><D:lockinfo xmlns:D="DAV:"><D:lockscope><D:exclusive/></D:lockscope><D:locktype><D:write/></D:locktype><D:owner><D:href>' + url + '/user</D:href></D:owner></D:lockinfo>'
138
138
} , ( e , res , body ) => _ ( e , ( ) => {
139
- const lock = body . substr ( body . indexOf ( '<D:locktoken><D:href>' ) + '<D:locktoken><D:href>' . length , 'urn:uuid:24fa520c-520c-14fa-00d6-0000d546f655' . length ) ;
139
+ const lock = body . substring ( body . indexOf ( '<D:locktoken><D:href>' ) + '<D:locktoken><D:href>' . length , body . indexOf ( '</D:href>' , body . indexOf ( '<D:locktoken><D:href>' ) ) ) ;
140
140
141
141
wfsOwner . writeFile ( '/testFolder/test5.txt' , 'Content!' , ( e ) => _ ( e , ( ) => {
142
142
wfsNotOwner . writeFile ( '/testFolder/test5.txt' , 'Content!' , ( e ) => {
0 commit comments