Merge pull request #2377 from wallabag/fix-exists-api

Fix exists API call
This commit is contained in:
Thomas Citharel 2016-10-05 19:52:06 +02:00 committed by GitHub
commit 9d127b3b93
2 changed files with 8 additions and 1 deletions

View File

@ -40,7 +40,7 @@ class WallabagRestController extends FOSRestController
$url = $request->query->get('url', '');
if (empty($url)) {
throw $this->createAccessDeniedException('URL is empty?, logged user id: '.$user->getId());
throw $this->createAccessDeniedException('URL is empty?, logged user id: '.$this->getUser()->getId());
}
$res = $this->getDoctrine()

View File

@ -804,4 +804,11 @@ class WallabagRestControllerTest extends WallabagApiTestCase
$this->assertEquals(false, $content['exists']);
}
public function testGetEntriesExistsWithNoUrl()
{
$this->client->request('GET', '/api/entries/exists?url=');
$this->assertEquals(403, $this->client->getResponse()->getStatusCode());
}
}