aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorJeremy Benoist <j0k3r@users.noreply.github.com>2016-11-22 11:27:55 +0100
committerGitHub <noreply@github.com>2016-11-22 11:27:55 +0100
commitbb28368f6953e07dbe6747d7c1eacf1abe35817e (patch)
treebac9d0e78d0908fa3c8e4c22900a6d7b2d456735 /src
parent944b8d61752bedd126e1cdaeb3205177e414cf6b (diff)
parent5cd0857e3c87541fa8a628b0623b8959bfba2ca8 (diff)
downloadwallabag-bb28368f6953e07dbe6747d7c1eacf1abe35817e.tar.gz
wallabag-bb28368f6953e07dbe6747d7c1eacf1abe35817e.tar.zst
wallabag-bb28368f6953e07dbe6747d7c1eacf1abe35817e.zip
Merge pull request #2635 from wallabag/304-reload
Return 304 when content isn't reloaded using the API
Diffstat (limited to 'src')
-rw-r--r--src/Wallabag/ApiBundle/Controller/EntryRestController.php6
1 files changed, 3 insertions, 3 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();