From 659ef8ebccb97eecede22c5e43d9f9bb3f35bdee Mon Sep 17 00:00:00 2001 From: "Jakob L. Kreuze" Date: Tue, 23 Jul 2024 19:37:01 -0400 Subject: [dynamic] Add "end time" for events --- api.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'api.scm') diff --git a/api.scm b/api.scm index fdc70ee..e3b121d 100644 --- a/api.scm +++ b/api.scm @@ -56,7 +56,7 @@ (define (clearnet-only handler) (lambda (request body) - (if (and (from-darknet? request) (not (%debug-enabled))) + (if (and (not (%debug-enabled)) (from-darknet? request)) (panic "This API is only available on the clearnet." #:code 403) (handler request body)))) @@ -77,7 +77,9 @@ (define (handle-api-request request body endpoint) "Route handler for the API server." (let ((method (request-method request)) - (originating-ip (assoc-ref (request-headers request) 'x-forwarded-for)) + (originating-ip (if (%debug-enabled) + "127.0.0.1" + (assoc-ref (request-headers request) 'x-forwarded-for))) (args (uri-query (request-uri request)))) (log-append! 'info (if args (format #f "~a ~a (~a) (~a)" method endpoint args originating-ip) -- cgit v1.3