summaryrefslogtreecommitdiff
path: root/src/scm/webid-oidc/reverse-proxy.scm
diff options
context:
space:
mode:
authorVivien Kraus <vivien@planete-kraus.eu>2021-08-09 18:46:48 +0200
committerVivien Kraus <vivien@planete-kraus.eu>2021-08-13 01:06:38 +0200
commitded10e28782f289ad3db15320bcf619ab4336876 (patch)
tree32609fd9f1eb0d2f8a23105e09f193827d16a275 /src/scm/webid-oidc/reverse-proxy.scm
parent7b62790238902e10edb83c07286cf0643b097997 (diff)
Switch to a more sensible error reporting system
Diffstat (limited to 'src/scm/webid-oidc/reverse-proxy.scm')
-rw-r--r--src/scm/webid-oidc/reverse-proxy.scm27
1 files changed, 17 insertions, 10 deletions
diff --git a/src/scm/webid-oidc/reverse-proxy.scm b/src/scm/webid-oidc/reverse-proxy.scm
index a1b05e3..30e6d48 100644
--- a/src/scm/webid-oidc/reverse-proxy.scm
+++ b/src/scm/webid-oidc/reverse-proxy.scm
@@ -1,4 +1,4 @@
-;; webid-oidc, implementation of the Solid specification
+;; disfluid, implementation of the Solid specification
;; Copyright (C) 2020, 2021 Vivien Kraus
;; This program is free software: you can redistribute it and/or modify
@@ -32,14 +32,20 @@
#:use-module (web response)
#:use-module (web client)
#:use-module (webid-oidc cache)
- #:use-module (web server))
+ #:use-module (webid-oidc web-i18n)
+ #:use-module (web server)
+ #:declarative? #t
+ #:export
+ (
+ make-reverse-proxy
+ ))
-(define*-public (make-reverse-proxy
- #:key
- (server-uri #f)
- (http-get http-get)
- (endpoint #f)
- (auth-header 'XXX-Agent))
+(define* (make-reverse-proxy
+ #:key
+ (server-uri #f)
+ (http-get http-get)
+ (endpoint #f)
+ (auth-header 'XXX-Agent))
(set! auth-header
;; We need to remove the lowercase version of auth-header from
;; all incoming requests!
@@ -51,7 +57,7 @@
#:server-uri server-uri
#:http-get http-get))
(unless (and endpoint (uri? endpoint))
- (error "#:endpoint argument is not present or not an URI."))
+ (fail (G_ "#:endpoint argument is not present or not an URI.")))
(lambda (request request-body)
(let ((agent
(catch #t
@@ -66,7 +72,8 @@
(else
(apply throw key args))))))
(request-time ((p:current-date))))
- (parameterize ((p:current-date request-time))
+ (parameterize ((p:current-date request-time)
+ (web-locale request))
;; The time is now set for the duration of the request
(let ((raw-headers (request-headers request)))
(let ((modified-headers