[Jifty-commit] r6626 - in jifty/trunk: lib/Jifty/Plugin/REST
Jifty commits
jifty-commit at lists.jifty.org
Tue Mar 17 13:12:44 EDT 2009
Author: sartak
Date: Tue Mar 17 13:12:44 2009
New Revision: 6626
Modified:
jifty/trunk/ (props changed)
jifty/trunk/lib/Jifty/Plugin/REST/Dispatcher.pm
Log:
r81288 at onn: sartak | 2009-03-17 13:12:38 -0400
Propagate output format across REST redirection
Modified: jifty/trunk/lib/Jifty/Plugin/REST/Dispatcher.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/REST/Dispatcher.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/REST/Dispatcher.pm Tue Mar 17 13:12:44 2009
@@ -929,9 +929,15 @@
my $rec = $action->{record};
if ($action->result->success && $rec and $rec->isa('Jifty::Record') and $rec->id) {
- my $url = Jifty->web->url(path => join '/', '=', map {
- Jifty::Web->escape_uri($_)
- } 'model', ref($rec), 'id', $rec->id);
+ my @fragments = ('model', ref($rec), 'id', $rec->id);
+
+ my $path = join '/', '=', map { Jifty::Web->escape_uri($_) } @fragments;
+
+ my $extension = output_format(\@fragments)->{extension};
+ $path .= '.' . $extension;
+
+ my $url = Jifty->web->url(path => $path);
+
Jifty->handler->apache->header_out('Location' => $url);
}
More information about the Jifty-commit
mailing list