summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--html.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/html.c b/html.c
index ef1374c..847a715 100644
--- a/html.c
+++ b/html.c
@@ -1830,12 +1830,14 @@ int html_get_handler(const xs_dict *req, const char *q_path,
1830 char *id = xs_list_get(l, 1); 1830 char *id = xs_list_get(l, 1);
1831 int sz; 1831 int sz;
1832 1832
1833 status = static_get(&snac, id, body, &sz, 1833 if (id && *id) {
1834 status = static_get(&snac, id, body, &sz,
1834 xs_dict_get(req, "if-none-match"), etag); 1835 xs_dict_get(req, "if-none-match"), etag);
1835 1836
1836 if (valid_status(status)) { 1837 if (valid_status(status)) {
1837 *b_size = sz; 1838 *b_size = sz;
1838 *ctype = xs_mime_by_ext(id); 1839 *ctype = xs_mime_by_ext(id);
1840 }
1839 } 1841 }
1840 } 1842 }
1841 else 1843 else
@@ -1843,13 +1845,17 @@ int html_get_handler(const xs_dict *req, const char *q_path,
1843 xs *l = xs_split(p_path, "/"); 1845 xs *l = xs_split(p_path, "/");
1844 char *id = xs_list_get(l, 1); 1846 char *id = xs_list_get(l, 1);
1845 1847
1846 if (xs_endswith(id, "timeline.html_")) { 1848 if (id && *id) {
1847 // Don't let them in. 1849 if (xs_endswith(id, "timeline.html_")) {
1848 *b_size = 0; 1850 /* Don't let them in */
1849 status = 404; 1851 *b_size = 0;
1850 } else if ((*body = history_get(&snac, id)) != NULL) { 1852 status = 404;
1851 *b_size = strlen(*body); 1853 }
1852 status = 200; 1854 else
1855 if ((*body = history_get(&snac, id)) != NULL) {
1856 *b_size = strlen(*body);
1857 status = 200;
1858 }
1853 } 1859 }
1854 } 1860 }
1855 else 1861 else