Correctly generate the feedback URL for remote share

The trailing slash was added in c78e3c4a7f
to correctly generate the encryption keys
This commit is contained in:
Joas Schilling 2015-04-14 11:27:51 +02:00
parent de8c15e1a4
commit 8f7c64253e
2 changed files with 3 additions and 3 deletions

View File

@ -235,7 +235,7 @@ class Manager {
*/
private function sendFeedbackToRemote($remote, $token, $id, $feedback) {
$url = $remote . \OCP\Share::BASE_PATH_TO_SHARE_API . '/' . $id . '/' . $feedback . '?format=' . \OCP\Share::RESPONSE_FORMAT;
$url = rtrim($remote, '/') . \OCP\Share::BASE_PATH_TO_SHARE_API . '/' . $id . '/' . $feedback . '?format=' . \OCP\Share::RESPONSE_FORMAT;
$fields = array('token' => $token);
$result = $this->httpHelper->post($url, $fields);

View File

@ -2426,7 +2426,7 @@ class Share extends Constants {
list($user, $remote) = explode('@', $shareWith, 2);
if ($user && $remote) {
$url = $remote . self::BASE_PATH_TO_SHARE_API . '?format=' . self::RESPONSE_FORMAT;
$url = rtrim($remote, '/') . self::BASE_PATH_TO_SHARE_API . '?format=' . self::RESPONSE_FORMAT;
$local = \OC::$server->getURLGenerator()->getAbsoluteURL('/');
@ -2459,7 +2459,7 @@ class Share extends Constants {
* @return bool
*/
private static function sendRemoteUnshare($remote, $id, $token) {
$url = $remote . self::BASE_PATH_TO_SHARE_API . '/' . $id . '/unshare?format=' . self::RESPONSE_FORMAT;
$url = rtrim($remote, '/') . self::BASE_PATH_TO_SHARE_API . '/' . $id . '/unshare?format=' . self::RESPONSE_FORMAT;
$fields = array('token' => $token, 'format' => 'json');
$result = self::tryHttpPost($url, $fields);
$status = json_decode($result['result'], true);