changeset 6006:748a41f12915

use http status 302 for #redirect processing instruction
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 04 Jan 2014 18:24:56 +0100
parents 9a9ad16c62fb
children 86090e014653
files MoinMoin/Page.py docs/CHANGES
diffstat 2 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/Page.py	Sat Nov 30 19:47:54 2013 +0100
+++ b/MoinMoin/Page.py	Sat Jan 04 18:24:56 2014 +0100
@@ -1037,7 +1037,11 @@
             redirect_url = Page(request, pagename).url(request,
                                                        querystr={'action': 'show', 'redirect': self.page_name, },
                                                        anchor=anchor)
-            request.http_redirect(redirect_url, code=301)
+            # we do NOT use 301 as a page edit may change the redirect to
+            # another target or even remove it again. so we can't really say
+            # it is permanent (301) or we might run into issues with clients
+            # like chrome that cache permanent redirects.
+            request.http_redirect(redirect_url, code=302)
             return
 
         # if necessary, load the formatter
--- a/docs/CHANGES	Sat Nov 30 19:47:54 2013 +0100
+++ b/docs/CHANGES	Sat Jan 04 18:24:56 2014 +0100
@@ -75,6 +75,9 @@
     logged-in users if the language identifier there was (partially) uppercase.
   * fix Python 2.7.4/5 compatibility issue with rss_rc action using handler._out
   * fix "moin import wikipage" timestamp confusion
+  * use 302 http status for #redirect as some clients cache 301 redirects, but
+    the #redirect might get changed or removed later (so it should not be
+    cached and we also can't really say it is permanent)
 
   Other changes:
   * rss_rc action (RSS feed) is now much faster / much less resource consuming