diff options
| author | 2022-09-28 05:22:08 +0200 | |
|---|---|---|
| committer | 2022-09-28 05:22:08 +0200 | |
| commit | b2c826400343cb0e56bf565b8b9c3072c998c22d (patch) | |
| tree | fd9d89535e0c1c312b37be5ed2f18077250d4edb /httpd.c | |
| parent | Check for muted actors in Announce messages. (diff) | |
| download | snac2-b2c826400343cb0e56bf565b8b9c3072c998c22d.tar.gz snac2-b2c826400343cb0e56bf565b8b9c3072c998c22d.tar.xz snac2-b2c826400343cb0e56bf565b8b9c3072c998c22d.zip | |
Added dummy HTTP handlers for html.
Diffstat (limited to 'httpd.c')
| -rw-r--r-- | httpd.c | 11 |
1 files changed, 10 insertions, 1 deletions
| @@ -127,20 +127,29 @@ void httpd_connection(int rs) | |||
| 127 | 127 | ||
| 128 | if (status == 0) | 128 | if (status == 0) |
| 129 | status = activitypub_get_handler(req, q_path, &body, &b_size, &ctype); | 129 | status = activitypub_get_handler(req, q_path, &body, &b_size, &ctype); |
| 130 | |||
| 131 | if (status == 0) | ||
| 132 | status = html_get_handler(req, q_path, &body, &b_size, &ctype); | ||
| 130 | } | 133 | } |
| 131 | else | 134 | else |
| 132 | if (strcmp(method, "POST") == 0) { | 135 | if (strcmp(method, "POST") == 0) { |
| 133 | if (status == 0) | 136 | if (status == 0) |
| 134 | status = activitypub_post_handler(req, q_path, | 137 | status = activitypub_post_handler(req, q_path, |
| 135 | payload, p_size, &body, &b_size, &ctype); | 138 | payload, p_size, &body, &b_size, &ctype); |
| 139 | |||
| 140 | if (status == 0) | ||
| 141 | status = html_post_handler(req, q_path, | ||
| 142 | payload, p_size, &body, &b_size, &ctype); | ||
| 136 | } | 143 | } |
| 137 | 144 | ||
| 138 | /* let's go */ | 145 | /* let's go */ |
| 139 | headers = xs_dict_new(); | 146 | headers = xs_dict_new(); |
| 140 | 147 | ||
| 141 | /* unattended? it's an error */ | 148 | /* unattended? it's an error */ |
| 142 | if (status == 0) | 149 | if (status == 0) { |
| 150 | srv_debug(1, xs_fmt("httpd_connection unattended %s %s", method, q_path)); | ||
| 143 | status = 404; | 151 | status = 404; |
| 152 | } | ||
| 144 | 153 | ||
| 145 | if (status == 404) | 154 | if (status == 404) |
| 146 | body = xs_str_new("<h1>404 Not Found</h1>"); | 155 | body = xs_str_new("<h1>404 Not Found</h1>"); |