page: indicate repost status in http redirects
authorMischa POSLAWSKY <perl@shiar.org>
Mon, 22 Feb 2021 00:37:15 +0000 (01:37 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 17 May 2021 18:53:38 +0000 (20:53 +0200)
Replace generic status 302 by specific HTTP2 options.
In particular prevent unrelated posts after login.

login/index.php
page.php

index 38b7c234465006445ac2d89491b9c3cc7c60cc7b..85dc2f54a3cd893d5a55e9b30318eb377753b09f 100644 (file)
@@ -59,7 +59,7 @@ if (!$User or !$User->login) {
 
 if (isset($_REQUEST['goto'])) {
        $target = ltrim($_REQUEST['goto'], '/');
-       abort("/$target", 302);
+       abort("/$target", '303 Return');
 }
 
 if (isset($Page->raw)) {
index 9f9ce626b0236e7ee5a805911861828422ae8e83..e634a3891896f120d67a75792c799cca45107609 100644 (file)
--- a/page.php
+++ b/page.php
@@ -16,7 +16,7 @@ $staticpage = "$request.html";
 if (file_exists($staticpage)) {
        if (is_link($staticpage)) {
                $target = preg_replace('/\.html$/', '', readlink($staticpage));
-               abort($target, '302 Shorthand');
+               abort($target, '307 Shorthand');
        }
 }
 elseif (file_exists("$request/index.html")) {