diff options
| author | 2023-07-14 05:23:44 +0000 | |
|---|---|---|
| committer | 2023-07-14 05:23:44 +0000 | |
| commit | 510bd60cdfd976d4493527faeb22a1d4c3328cc6 (patch) | |
| tree | 72702744a00dbd30cf12aef664b419d90501058b /html.c | |
| parent | If a Page has an image, show it as an attachment. (diff) | |
| parent | html.c: Don't let public get into timeline.html_ (diff) | |
| download | snac2-510bd60cdfd976d4493527faeb22a1d4c3328cc6.tar.gz snac2-510bd60cdfd976d4493527faeb22a1d4c3328cc6.tar.xz snac2-510bd60cdfd976d4493527faeb22a1d4c3328cc6.zip | |
Merge pull request 'html.c: Don't let public get into timeline.html_' (#67) from yonle/snac2:master into master
Reviewed-on: https://codeberg.org/grunfink/snac2/pulls/67
Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 6 |
1 files changed, 5 insertions, 1 deletions
| @@ -1843,7 +1843,11 @@ int html_get_handler(const xs_dict *req, const char *q_path, | |||
| 1843 | xs *l = xs_split(p_path, "/"); | 1843 | xs *l = xs_split(p_path, "/"); |
| 1844 | char *id = xs_list_get(l, 1); | 1844 | char *id = xs_list_get(l, 1); |
| 1845 | 1845 | ||
| 1846 | if ((*body = history_get(&snac, id)) != NULL) { | 1846 | if (xs_endswith(id, "timeline.html_")) { |
| 1847 | // Don't let them in. | ||
| 1848 | *b_size = 0; | ||
| 1849 | status = 404; | ||
| 1850 | } else if ((*body = history_get(&snac, id)) != NULL) { | ||
| 1847 | *b_size = strlen(*body); | 1851 | *b_size = strlen(*body); |
| 1848 | status = 200; | 1852 | status = 200; |
| 1849 | } | 1853 | } |