From 2cfd5ea44f179aa5c0667d904e2771e8feffb5b6 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Tue, 5 Jul 2022 01:45:23 +0530 Subject: web: server: Error out on unknown host. * tissue/web/server.scm: Import (rnrs conditions) and (rnrs exceptions). (handler): Error out on unknown host. --- tissue/web/server.scm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tissue/web/server.scm b/tissue/web/server.scm index 338598e..d07e629 100644 --- a/tissue/web/server.scm +++ b/tissue/web/server.scm @@ -17,6 +17,8 @@ ;;; along with tissue. If not, see . (define-module (tissue web server) + #:use-module (rnrs conditions) + #:use-module (rnrs exceptions) #:use-module (rnrs io ports) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) @@ -177,11 +179,9 @@ STATE-DIRECTORY." (hostname (match (assq-ref (request-headers request) 'host) ((hostname . _) hostname))) (host-parameters (or (assoc-ref hosts hostname) - ;; If no matching host is found, pick the - ;; first known host. - (match hosts - (((_ . host-parameters) _ ...) - host-parameters))))) + (raise (condition + (make-message-condition "Unknown host") + (make-irritants-condition hostname)))))) (format #t "~a ~a\n" (request-method request) path) -- cgit v1.2.3