diff options
-rw-r--r-- | src/Wallabag/ApiBundle/Controller/WallabagRestController.php | 2 | ||||
-rw-r--r-- | tests/Wallabag/ApiBundle/Controller/WallabagRestControllerTest.php | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php index 791bf80b..a0d9d4f3 100644 --- a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php +++ b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php | |||
@@ -40,7 +40,7 @@ class WallabagRestController extends FOSRestController | |||
40 | $url = $request->query->get('url', ''); | 40 | $url = $request->query->get('url', ''); |
41 | 41 | ||
42 | if (empty($url)) { | 42 | if (empty($url)) { |
43 | throw $this->createAccessDeniedException('URL is empty?, logged user id: '.$user->getId()); | 43 | throw $this->createAccessDeniedException('URL is empty?, logged user id: '.$this->getUser()->getId()); |
44 | } | 44 | } |
45 | 45 | ||
46 | $res = $this->getDoctrine() | 46 | $res = $this->getDoctrine() |
diff --git a/tests/Wallabag/ApiBundle/Controller/WallabagRestControllerTest.php b/tests/Wallabag/ApiBundle/Controller/WallabagRestControllerTest.php index fd72b8f2..65b65290 100644 --- a/tests/Wallabag/ApiBundle/Controller/WallabagRestControllerTest.php +++ b/tests/Wallabag/ApiBundle/Controller/WallabagRestControllerTest.php | |||
@@ -804,4 +804,11 @@ class WallabagRestControllerTest extends WallabagApiTestCase | |||
804 | 804 | ||
805 | $this->assertEquals(false, $content['exists']); | 805 | $this->assertEquals(false, $content['exists']); |
806 | } | 806 | } |
807 | |||
808 | public function testGetEntriesExistsWithNoUrl() | ||
809 | { | ||
810 | $this->client->request('GET', '/api/entries/exists?url='); | ||
811 | |||
812 | $this->assertEquals(403, $this->client->getResponse()->getStatusCode()); | ||
813 | } | ||
807 | } | 814 | } |