[Slashdotjp-dev 1217] [745] Add feature to change redirect status code on redirect()

アーカイブの一覧に戻る

svnno****@sourc***** svnno****@sourc*****
2008年 9月 16日 (火) 21:03:05 JST


Revision: 745
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=slashdotjp&view=rev&rev=745
Author:   tach
Date:     2008-09-16 21:03:04 +0900 (Tue, 16 Sep 2008)

Log Message:
-----------
Add feature to change redirect status code on redirect()

Modified Paths:
--------------
    slashjp/branches/2.5.0.192/Slash/Utility/Anchor/Anchor.pm
    slashjp/branches/2.5.0.192/debian/changelog


-------------- next part --------------
Modified: slashjp/branches/2.5.0.192/Slash/Utility/Anchor/Anchor.pm
===================================================================
--- slashjp/branches/2.5.0.192/Slash/Utility/Anchor/Anchor.pm	2008-09-12 13:40:36 UTC (rev 744)
+++ slashjp/branches/2.5.0.192/Slash/Utility/Anchor/Anchor.pm	2008-09-16 12:03:04 UTC (rev 745)
@@ -395,14 +395,15 @@
 =cut
 
 sub redirect {
-	my($url) = @_;
+	my($url, $code) = @_;
+	$code ||= 302;
 	my $constants = getCurrentStatic();
 	$url = url2abs($url);
 	my $r = Apache->request;
 
 	$r->content_type($constants->{content_type_webpage} || 'text/html');
 	$r->header_out(Location => $url);
-	$r->status(302);
+	$r->status($code);
 	$r->send_http_header;
 
 	slashDisplay('html-redirect', { url => $url });

Modified: slashjp/branches/2.5.0.192/debian/changelog
===================================================================
--- slashjp/branches/2.5.0.192/debian/changelog	2008-09-12 13:40:36 UTC (rev 744)
+++ slashjp/branches/2.5.0.192/debian/changelog	2008-09-16 12:03:04 UTC (rev 745)
@@ -11,8 +11,9 @@
     - Fix: slashDisplay() option 'Skin' does not applied
   * Add logcheck ignore rule for SearchEst
   * Add plugins/Journal/journal_update_slashbox.pl to create topjournal blocks
+  * Add feature to change redirect status code on redirect()
 
- -- Taku YASUI <tach****@osdn*****>  Fri, 12 Sep 2008 13:40:01 +0000
+ -- Taku YASUI <tach****@osdn*****>  Tue, 16 Sep 2008 12:02:15 +0000
 
 slash (2.5.0.192-16) unstable; urgency=low
 


Slashdotjp-dev メーリングリストの案内
アーカイブの一覧に戻る