[Jifty-commit] jifty branch, master, updated. d35b6cbe6ee11c2b370aaee120c4c6fc66e3a998

Jifty commits jifty-commit at lists.jifty.org
Wed Sep 22 15:02:48 EDT 2010


The branch, master has been updated
       via  d35b6cbe6ee11c2b370aaee120c4c6fc66e3a998 (commit)
      from  36cc491e8b1424a6d79bc3e7aad57dbb753467e9 (commit)

Summary of changes:
 lib/Jifty/Plugin/REST/Dispatcher.pm |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

- Log -----------------------------------------------------------------
commit d35b6cbe6ee11c2b370aaee120c4c6fc66e3a998
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Wed Sep 22 14:59:24 2010 -0400

    Cache bust before returning a 302 Found from the REST API
    
    This ensures the record is still around after the action.  Delete
    actions were sometimes leaving the cached ID around and causing us to
    return an invalid Location: header.

diff --git a/lib/Jifty/Plugin/REST/Dispatcher.pm b/lib/Jifty/Plugin/REST/Dispatcher.pm
index b82d768..4415957 100644
--- a/lib/Jifty/Plugin/REST/Dispatcher.pm
+++ b/lib/Jifty/Plugin/REST/Dispatcher.pm
@@ -962,7 +962,7 @@ sub run_action {
     }
 
     my $rec = $action->{record};
-    if ($action->result->success && $rec and $rec->isa('Jifty::Record') and $rec->id) {
+    if ($action->result->success && $rec and $rec->isa('Jifty::Record') and $rec->id and ($rec->load($rec->id))[0]) {
         my @fragments = ('model', ref($rec), 'id', $rec->id);
 
         my $path = join '/', '=', map { Jifty::Web->escape_uri($_) } @fragments;

-----------------------------------------------------------------------


More information about the Jifty-commit mailing list