comparison MoinMoin/Page.py @ 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 be11f1e64e73
children 54dc774ff49b
comparison
equal deleted inserted replaced
6005:9a9ad16c62fb 6006:748a41f12915
1035 # (see code in "request") or any cascaded redirection 1035 # (see code in "request") or any cascaded redirection
1036 pagename, anchor = wikiutil.split_anchor(pi['redirect']) 1036 pagename, anchor = wikiutil.split_anchor(pi['redirect'])
1037 redirect_url = Page(request, pagename).url(request, 1037 redirect_url = Page(request, pagename).url(request,
1038 querystr={'action': 'show', 'redirect': self.page_name, }, 1038 querystr={'action': 'show', 'redirect': self.page_name, },
1039 anchor=anchor) 1039 anchor=anchor)
1040 request.http_redirect(redirect_url, code=301) 1040 # we do NOT use 301 as a page edit may change the redirect to
1041 # another target or even remove it again. so we can't really say
1042 # it is permanent (301) or we might run into issues with clients
1043 # like chrome that cache permanent redirects.
1044 request.http_redirect(redirect_url, code=302)
1041 return 1045 return
1042 1046
1043 # if necessary, load the formatter 1047 # if necessary, load the formatter
1044 if self.default_formatter: 1048 if self.default_formatter:
1045 from MoinMoin.formatter.text_html import Formatter 1049 from MoinMoin.formatter.text_html import Formatter