mirror of
https://gitlab.linphone.org/BC/public/flexisip-account-manager.git
synced 2026-01-17 01:58:07 +00:00
Fix #165 Remove for now text/vcard header constraint
This commit is contained in:
parent
debf668e77
commit
911862870c
4 changed files with 18 additions and 16 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
v1.5
|
||||
----
|
||||
- Fix FLEXIAPI-165 Remove for now text/vcard header constraint
|
||||
- Fix FLEXIAPI-164 Add vcards-storage endpoints
|
||||
- Fix FLEXIAPI-162 Drop the aliases table and migrate the data to the phone column
|
||||
- Fix FLEXIAPI-161 Complete the Dictionary tests to cover the collection accessor
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ class VcardsStorageController extends Controller
|
|||
{
|
||||
public function index(Request $request)
|
||||
{
|
||||
if ($this->vcardRequested($request)) {
|
||||
//if ($this->vcardRequested($request)) {
|
||||
$vcards = '';
|
||||
|
||||
foreach ($request->user()->vcardsStorage()->get() as $vcard) {
|
||||
|
|
@ -17,21 +17,21 @@ class VcardsStorageController extends Controller
|
|||
}
|
||||
|
||||
return $vcards;
|
||||
}
|
||||
/*}
|
||||
|
||||
abort(404);
|
||||
abort(404);*/
|
||||
}
|
||||
|
||||
public function show(Request $request, string $uuid)
|
||||
{
|
||||
return ($this->vcardRequested($request))
|
||||
? $request->user()->vcardsStorage()->where('uuid', $uuid)->firstOrFail()->vcard
|
||||
: abort(404);
|
||||
return /*($this->vcardRequested($request))
|
||||
?*/ $request->user()->vcardsStorage()->where('uuid', $uuid)->firstOrFail()->vcard
|
||||
/*: abort(404)*/;
|
||||
}
|
||||
|
||||
private function vcardRequested(Request $request): bool
|
||||
/*private function vcardRequested(Request $request): bool
|
||||
{
|
||||
return $request->hasHeader('content-type') == 'text/vcard'
|
||||
&& $request->hasHeader('accept') == 'text/vcard';
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
|
|
|||
|
|
@ -763,12 +763,13 @@ Return a specific user authenticated contact, in [vCard 4.0 format](https://data
|
|||
|
||||
## vCards Storage
|
||||
|
||||
<!---
|
||||
The following headers are mandatory to access the following endpoints:
|
||||
|
||||
```
|
||||
> content-type: text/vcard
|
||||
> accept: text/vcard
|
||||
```
|
||||
--->
|
||||
|
||||
### `GET /vcards-storage`
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ FN:Simone Perreault
|
|||
UID:' . $uid . '
|
||||
END:VCARD
|
||||
';
|
||||
$uid2 = 'urn:uuid: a5b33443-687c-4d19-bdd0-b30cf76bf96d';
|
||||
$uid2 = 'urn:uuid:a5b33443-687c-4d19-bdd0-b30cf76bf96d';
|
||||
$secondVcard =
|
||||
'BEGIN:VCARD
|
||||
VERSION:4.0
|
||||
|
|
@ -136,25 +136,25 @@ END:VCARD'
|
|||
]);
|
||||
|
||||
// Vcard format endpoints
|
||||
$this->keyAuthenticated($account)
|
||||
/*$this->keyAuthenticated($account)
|
||||
->get('vcards-storage')
|
||||
->assertStatus(404);
|
||||
->assertStatus(404);*/
|
||||
|
||||
$this->keyAuthenticated($account)
|
||||
->withHeaders([
|
||||
/*->withHeaders([
|
||||
'content-type' => 'text/vcard',
|
||||
'accept' => 'text/vcard',
|
||||
])
|
||||
])*/
|
||||
->get('vcards-storage')
|
||||
->assertStatus(200)
|
||||
->assertSee($lastVcard)
|
||||
->assertSee($secondVcard);
|
||||
|
||||
$this->keyAuthenticated($account)
|
||||
->withHeaders([
|
||||
/*->withHeaders([
|
||||
'content-type' => 'text/vcard',
|
||||
'accept' => 'text/vcard',
|
||||
])
|
||||
])*/
|
||||
->get('vcards-storage/' . $uid)
|
||||
->assertStatus(200)
|
||||
->assertSee($lastVcard);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue