summaryrefslogtreecommitdiff
path: root/api.scm
diff options
context:
space:
mode:
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)