summaryrefslogtreecommitdiff
path: root/src/ot_http.c
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2026-11-05 14:57:13 +0100
committerDirk Engling <erdgeist@erdgeist.org>2026-11-05 14:57:13 +0100
commit14f1f19dab3f41b5bcaeb40f63964c57eb1e25f2 (patch)
tree0bc8c1973d6d58bc8e14676cca108d50254aa6e1 /src/ot_http.c
parent6b4703f21deb0f140dbbeca682823f2b644a4e78 (diff)
Step 2 of the WANT_RESTRICT_FULLSCRAPE feature (fixing a bug along the way)
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;