diff options
-rw-r--r-- | src/Wallabag/ApiBundle/Controller/EntryRestController.php | 6 | ||||
-rw-r--r-- | tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php | 6 |
2 files changed, 4 insertions, 8 deletions
diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php index 1a726b6e..2c2ec0c1 100644 --- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php +++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php | |||
@@ -287,7 +287,7 @@ class EntryRestController extends WallabagRestController | |||
287 | 287 | ||
288 | /** | 288 | /** |
289 | * Reload an entry. | 289 | * Reload an entry. |
290 | * A response with HTTP Status 400 will be return if we weren't able to update the content (because it hasn't changed or we got an error). | 290 | * An empty response with HTTP Status 304 will be send if we weren't able to update the content (because it hasn't changed or we got an error). |
291 | * | 291 | * |
292 | * @ApiDoc( | 292 | * @ApiDoc( |
293 | * requirements={ | 293 | * requirements={ |
@@ -310,12 +310,12 @@ class EntryRestController extends WallabagRestController | |||
310 | 'entry' => $entry, | 310 | 'entry' => $entry, |
311 | ]); | 311 | ]); |
312 | 312 | ||
313 | return new JsonResponse(['error' => 'Error while trying to fetch content'], 400); | 313 | return new JsonResponse([], 304); |
314 | } | 314 | } |
315 | 315 | ||
316 | // if refreshing entry failed, don't save it | 316 | // if refreshing entry failed, don't save it |
317 | if ($this->getParameter('wallabag_core.fetching_error_message') === $entry->getContent()) { | 317 | if ($this->getParameter('wallabag_core.fetching_error_message') === $entry->getContent()) { |
318 | return new JsonResponse(['error' => 'Error while trying to extract content'], 400); | 318 | return new JsonResponse([], 304); |
319 | } | 319 | } |
320 | 320 | ||
321 | $em = $this->getDoctrine()->getManager(); | 321 | $em = $this->getDoctrine()->getManager(); |
diff --git a/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php b/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php index 432ce7d8..409a8291 100644 --- a/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php +++ b/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php | |||
@@ -690,11 +690,7 @@ class EntryRestControllerTest extends WallabagApiTestCase | |||
690 | } | 690 | } |
691 | 691 | ||
692 | $this->client->request('PATCH', '/api/entries/'.$entry->getId().'/reload.json'); | 692 | $this->client->request('PATCH', '/api/entries/'.$entry->getId().'/reload.json'); |
693 | $this->assertEquals(400, $this->client->getResponse()->getStatusCode()); | 693 | $this->assertEquals(304, $this->client->getResponse()->getStatusCode()); |
694 | |||
695 | $this->assertContains('Error while trying to extract content', $this->client->getResponse()->getContent()); | ||
696 | |||
697 | $this->assertEquals('application/json', $this->client->getResponse()->headers->get('Content-Type')); | ||
698 | } | 694 | } |
699 | 695 | ||
700 | public function testReloadEntry() | 696 | public function testReloadEntry() |