Commit Diff


commit - a12e95aa4f4bd26d33190a08f9a4ef6662bd28dd
commit + f267a4befa8df8111c313f4ca57dfd39eb69a24e
blob - cc4e3c2e84c64203e3c6cfa9b89bf82b798e29c1
blob + e4645b4cd4117cf58f9c1be7c57cd19479f5306f
--- fragments.tmpl
+++ fragments.tmpl
@@ -36,7 +36,7 @@
 {!
 	struct client *clt = tp->tp_arg;
 	struct proxy_config *pc = clt->clt_pc;
-	const char *stylesheet = pc->stylesheet;
+	const char *stylesheet = pc ? pc->stylesheet : "";
 	const char *prfx = clt->clt_script_name;
 	const char *path = clt->clt_path_info;
 !}
@@ -54,7 +54,7 @@
 		<title>
 			{{ if title }}
 				{{ title }}
-			{{ else }}
+			{{ else if pc }}
 				gemini://{{ pc->proxy_name }}{{ path }}
 			{{ end }}
 		</title>
@@ -66,24 +66,24 @@
 {!
 	struct client *clt = tp->tp_arg;
 	struct proxy_config *pc = clt->clt_pc;
-	const char *host = pc->proxy_name;
 	const char *path = clt->clt_path_info;
 
 	if (path == NULL)
 		path = "";
 !}
-
+	{{ if pc }}
 		<footer>
 			<hr />
 			<dl>
 				<dt>Original URL:</dt>
 				<dd>
-<a href="gemini://{{ host | urlescape }}{{ path | urlescape }}">
-gemini://{{ host }}{{ path }}
+<a href="gemini://{{ pc->proxy_name | urlescape }}{{ path | urlescape }}">
+gemini://{{ pc->proxy_name }}{{ path }}
 </a>
 				</dd>
 			</dl>
 		</footer>
+	{{ end }}
 	</body>
 </html>
 {{ end }}