diff options
Diffstat (limited to 'module/web')
-rw-r--r-- | module/web/client.scm | 2 | ||||
-rw-r--r-- | module/web/uri.scm | 20 |
2 files changed, 13 insertions, 9 deletions
diff --git a/module/web/client.scm b/module/web/client.scm index 6a04497cf..b0356680d 100644 --- a/module/web/client.scm +++ b/module/web/client.scm @@ -27,7 +27,7 @@ ;;; the web server. ;;; ;;; Another option, good but not as performant, would be to use threads, -;;; possibly via par-map or futures. +;;; possibly via a thread pool. ;;; ;;; Code: diff --git a/module/web/uri.scm b/module/web/uri.scm index 6f9377c19..67ecbaeb2 100644 --- a/module/web/uri.scm +++ b/module/web/uri.scm @@ -125,14 +125,18 @@ consistency checks to make sure that the constructed URI is valid." userinfo-pat host-pat port-pat))) (define (parse-authority authority fail) - (let ((m (regexp-exec authority-regexp authority))) - (if (and m (valid-host? (match:substring m 3))) - (values (match:substring m 2) - (match:substring m 3) - (let ((port (match:substring m 5))) - (and port (not (string-null? port)) - (string->number port)))) - (fail)))) + (if (equal? authority "//") + ;; Allow empty authorities: file:///etc/hosts is a synonym of + ;; file:/etc/hosts. + (values #f #f #f) + (let ((m (regexp-exec authority-regexp authority))) + (if (and m (valid-host? (match:substring m 3))) + (values (match:substring m 2) + (match:substring m 3) + (let ((port (match:substring m 5))) + (and port (not (string-null? port)) + (string->number port)))) + (fail))))) ;;; RFC 3986, #3. |