Commit Diff


commit - dc70a51316a58c9950d7ddb957c292472c61b263dcb690b43154606f803401fe
commit + 8fdc2fde6f60b95d63c5499d04439d1ffdf3e9db1487dcecfa6c9616358f014d
blob - 156a3f313fc90a6df2aac13a704945f76eadec7ba8ee43b7320ba28603a58236
blob + d53549f02e62626fd8b9d3f7bff8277dccb0f5e5c1c0c49c637a9d79f321aaf4
--- gotwebd/auth.c	
+++ gotwebd/auth.c	
@@ -291,7 +291,6 @@ do_login(struct request *c)
 	char *token = NULL;
 	const char *identifier = NULL;
 	const time_t validity = 24 * 60 * 60; /* 1 day */
-	struct gotweb_url url;
 	struct gotwebd_repo *repo;
 
 	int r;
@@ -398,9 +397,10 @@ logged_in:
 		goto err;
 	}
 
-	memset(&url, 0, sizeof(url));
-	url.action = INDEX;
-	gotweb_reply(c, 307, "text/html", &url);
+	if (gotweb_reply(c, 200, "text/html", NULL) == -1)
+		return;
+	gotweb_render_fake_redirect(c->tp);
+
 	return;
 
 err:
blob - c847e0c272361c2cad1c16a4790eddd58a58db761cf1bc1621ccd266d3368ee5
blob + 89508f5e4e693d889e9fdf58f6023c4ea46f1c401abfa84291325ec4923697a9
--- gotwebd/gotwebd.h	
+++ gotwebd/gotwebd.h	
@@ -667,6 +667,7 @@ int	gotweb_render_blame(struct template *);
 int	gotweb_render_patch(struct template *);
 int	gotweb_render_rss(struct template *);
 int	gotweb_render_unauthorized(struct template *);
+int	gotweb_render_fake_redirect(struct template *);
 
 /* parse.y */
 struct gotwebd_repo * gotwebd_new_repo(const char *);
blob - 2021ad223878857aef27e1b8ae89f5b4b0c870d5a9bdfb0e0197f62a8c24e0bd
blob + 983b65414e6c1e07212a8abadfd201546689211ca16080339203979c02cc6fca
--- gotwebd/pages.tmpl	
+++ gotwebd/pages.tmpl	
@@ -1468,3 +1468,21 @@ date: {{ datebuf }} {{ " UTC" }} {{ "\n" }}
 {{ define gotweb_render_unauthorized(struct template *tp) }}
 <p>Wrong or missing authentication code</p>
 {{ end }}
+
+{{ define gotweb_render_fake_redirect(struct template *tp) }}
+{!
+	struct gotweb_url url;
+	memset(&url, 0, sizeof(url));
+	url.action = INDEX;
+!}
+<html>
+<head>
+  <meta http-equiv="refresh" content="0;url={{ render gotweb_render_url(tp->tp_arg, &url) }}">
+</head>
+<body>
+<p>
+  Please <a href="{{ render gotweb_render_url(tp->tp_arg, &url) }}">click here</a>
+  {{ " " }} if the page does not redirect automatically.
+</body>
+</html>
+{{ end }}