public function asCreatingAShareWith($user, $body) {
$fullUrl = $this->baseUrl . "v{$this->apiVersion}.php/apps/files_sharing/api/v{$this->sharingApiVersion}/shares";
$client = new Client();
- $options = [];
+ $options = [
+ 'headers' => [
+ 'OCS-APIREQUEST' => 'true',
+ ],
+ ];
if ($user === 'admin') {
$options['auth'] = $this->adminUser;
} else {
$share_id = (string) $this->lastShareData->data[0]->id;
$fullUrl = $this->baseUrl . "v{$this->apiVersion}.php/apps/files_sharing/api/v{$this->sharingApiVersion}/shares/$share_id";
$client = new Client();
- $options = [];
+ $options = [
+ 'headers' => [
+ 'OCS-APIREQUEST' => 'true',
+ ],
+ ];
if ($this->currentUser === 'admin') {
$options['auth'] = $this->adminUser;
} else {
$permissions = null){
$fullUrl = $this->baseUrl . "v{$this->apiVersion}.php/apps/files_sharing/api/v{$this->sharingApiVersion}/shares";
$client = new Client();
- $options = [];
+ $options = [
+ 'headers' => [
+ 'OCS-APIREQUEST' => 'true',
+ ],
+ ];
if ($user === 'admin') {
$options['auth'] = $this->adminUser;
} else {
$options['auth'] = [$user1, $this->regularUser];
}
+ $options['headers'] = [
+ 'OCS-APIREQUEST' => 'true',
+ ];
$this->response = $client->get($fullUrl, $options);
if ($this->isUserOrGroupInSharedData($user2, $permissions)){
return;
} else {
$options['auth'] = [$user, $this->regularUser];
}
+ $options['headers'] = [
+ 'OCS-APIREQUEST' => 'true',
+ ];
$this->response = $client->get($fullUrl, $options);
if ($this->isUserOrGroupInSharedData($group, $permissions)){
return;
],
'headers' => [
'Content-Type' => 'application/json',
+ 'OCS-APIREQUEST' => 'true',
],
]
);
],
'headers' => [
'Content-Type' => 'application/json',
+ 'OCS-APIREQUEST' => 'true',
],
]
);