Skip to content

Commit 53945c4

Browse files
committed
no longer accept 'append' for PUT requests
1 parent d65df9a commit 53945c4

1 file changed

Lines changed: 3 additions & 16 deletions

File tree

src/WAC.php

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -279,22 +279,9 @@ public function getRequestedGrants($request) {
279279
break;
280280
case "PUT":
281281
if ($this->filesystem->has($path)) {
282-
$body = $request->getBody()->getContents();
283-
$request->getBody()->rewind();
284-
285-
$existingFile = $this->filesystem->read($path);
286-
if (strpos($body, $existingFile) === 0) { // new file starts with the content of the old, so 'Append' grant wil suffice;
287-
return array(
288-
"resource" => array(
289-
'http://www.w3.org/ns/auth/acl#Write',
290-
'http://www.w3.org/ns/auth/acl#Append'
291-
)
292-
);
293-
} else {
294-
return array(
295-
"resource" => array('http://www.w3.org/ns/auth/acl#Write')
296-
);
297-
}
282+
return array(
283+
"resource" => array('http://www.w3.org/ns/auth/acl#Write')
284+
);
298285
} else {
299286
// FIXME: to add a new file, Append is needed on the parent container;
300287
return array(

0 commit comments

Comments
 (0)