Commit Diff


commit - c7586aab80af8e3fd32ac08872c97f4e41484369
commit + 0b1053d201cb8eb2b3dcc32f42f8f52188358884
blob - 1e88a1b2f0b845eba10466b1a99d092d074b8a74
blob + 162f1d3465d1a0c278727a936e2eb5a557b036bb
--- telescope.c
+++ telescope.c
@@ -103,6 +103,7 @@ static void		 handle_imsg_update_cert_ok(struct imsg *
 static void		 handle_dispatch_imsg(int, short, void*);
 static int		 load_page_from_str(struct tab*, const char*);
 static int		 load_about_url(struct tab*, const char*);
+static int		 load_file_url(struct tab *, const char *);
 static int		 load_finger_url(struct tab *, const char *);
 static int		 load_gemini_url(struct tab*, const char*);
 static int		 load_gopher_url(struct tab *, const char *);
@@ -124,6 +125,7 @@ static struct proto {
 	int		 (*loadfn)(struct tab*, const char*);
 } protos[] = {
 	{"about",	NULL,	load_about_url},
+	{"file",	NULL,	load_file_url},
 	{"finger",	"79",	load_finger_url},
 	{"gemini",	"1965",	load_gemini_url},
 	{"gopher",	"70",	load_gopher_url},
@@ -584,6 +586,13 @@ load_about_url(struct tab *tab, const char *url)
 }
 
 static int
+load_file_url(struct tab *tab, const char *url)
+{
+	tab->trust = TS_UNKNOWN;
+	return make_fs_request(tab, IMSG_GET_FILE, tab->uri.path);
+}
+
+static int
 load_finger_url(struct tab *tab, const char *url)
 {
 	struct get_req	 req;