+(define (valid-hostname name)
+ (let*
+ ((host-label-part '(+ (or alphanumeric #\- #\_)))
+ (domain-part `(: #\. ,host-label-part))
+ (hostname-regex `(: ,host-label-part (+ ,domain-part))))
+ (irregex-match? hostname-regex name)))
+
+(define (existing-host config uri)
+ (directory-exists? (make-pathname (config-root-dir config) (uri-host uri))))
+