Commit Diff


commit - 8fdc2fde6f60b95d63c5499d04439d1ffdf3e9db1487dcecfa6c9616358f014d
commit + e5b11b7968a46690c526716db076b7f004336c685780ae827be8307aaa199ff9
blob - 983b65414e6c1e07212a8abadfd201546689211ca16080339203979c02cc6fca
blob + c9413bad57b9870d4db90a2321916d8820a02a84355e79418068b032e6014ea9
--- gotwebd/pages.tmpl	
+++ gotwebd/pages.tmpl	
@@ -1471,13 +1471,41 @@ date: {{ datebuf }} {{ " UTC" }} {{ "\n" }}
 
 {{ define gotweb_render_fake_redirect(struct template *tp) }}
 {!
-	struct gotweb_url url;
+	struct request		*c = tp->tp_arg;
+	struct server		*srv = c->srv;
+	char			 prefix[MAX_DOCUMENT_URI * 2];
+	const char		*css = srv->custom_css;
+	const char		*url_root, *url_path;
+	struct gotweb_url	url;
+
+	strlcpy(prefix, "/", sizeof(prefix));
+
+	url_root = srv->gotweb_url_root;
+	while (url_root[0] == '/')
+		url_root++;
+	if (url_root[0] != '\0')
+		strlcat(prefix, url_root, sizeof(prefix));
+
+	url_path = srv->repos_url_path;
+	while (url_path[0] == '/')
+		url_path++;
+	if (url_path[0] != '\0') {
+		if (url_root[0] != '\0') {
+			got_path_strip_trailing_slashes(prefix);
+			strlcat(prefix, "/", sizeof(prefix));
+		}
+		strlcat(prefix, url_path, sizeof(prefix));
+	}
+
+	got_path_strip_trailing_slashes(prefix);
+
 	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) }}">
+  <link rel="stylesheet" type="text/css" href="{{ prefix }}/{{ css }}" />
 </head>
 <body>
 <p>