summaryrefslogtreecommitdiff
path: root/src/ot_http.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ot_http.c')
-rw-r--r--src/ot_http.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ot_http.c b/src/ot_http.c
index d2dad67..cc11366 100644
--- a/src/ot_http.c
+++ b/src/ot_http.c
@@ -342,6 +342,10 @@ static ssize_t http_handle_stats(const int64_t sock, struct ot_workstruct *ws, c
342 } 342 }
343 343
344 if (mode == TASK_STATS_TPB) { 344 if (mode == TASK_STATS_TPB) {
345#ifdef WANT_RESTRICT_FULLSCRAPE
346 if (!accesslist_is_blessed(cookie->ip, OT_PERMISSION_MAY_FULLSCRAPE))
347 HTTPERROR_403_IP;
348#endif
345#ifdef WANT_COMPRESSION_GZIP 349#ifdef WANT_COMPRESSION_GZIP
346 ws->request[ws->request_size - 1] = 0; 350 ws->request[ws->request_size - 1] = 0;
347#ifndef WANT_COMPRESSION_GZIP_ALWAYS 351#ifndef WANT_COMPRESSION_GZIP_ALWAYS
@@ -402,6 +406,9 @@ static ssize_t http_handle_fullscrape(const int64_t sock, struct ot_workstruct *
402 struct http_data *cookie = fdstate_cookie(sock); 406 struct http_data *cookie = fdstate_cookie(sock);
403 int format = 0; 407 int format = 0;
404 408
409 if (!cookie)
410 HTTPERROR_500;
411
405#ifdef WANT_RESTRICT_FULLSCRAPE 412#ifdef WANT_RESTRICT_FULLSCRAPE
406 if (!accesslist_is_blessed(cookie->ip, OT_PERMISSION_MAY_FULLSCRAPE)) 413 if (!accesslist_is_blessed(cookie->ip, OT_PERMISSION_MAY_FULLSCRAPE))
407 HTTPERROR_403_IP; 414 HTTPERROR_403_IP;