summaryrefslogtreecommitdiff
path: root/api.scm
diff options
context:
space:
mode:
authorJakob L. Kreuze <zerodaysfordays@sdf.org>2024-07-23 19:37:01 -0400
committerJakob L. Kreuze <zerodaysfordays@sdf.org>2024-07-23 19:37:01 -0400
commit659ef8ebccb97eecede22c5e43d9f9bb3f35bdee (patch)
tree5eee34f7e9705d946da6a221bd5f3cd6545e569c /api.scm
parentb38ff0788e83c0364b6d6aca2b7acc50cd61dcfc (diff)
[dynamic] Add "end time" for events
Diffstat (limited to 'api.scm')
-rw-r--r--api.scm6
1 files changed, 4 insertions, 2 deletions
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)