diff options
author | 2009-07-02 19:47:30 +0200 | |
---|---|---|
committer | 2009-07-02 19:47:30 +0200 | |
commit | eac799afc38391234acfd0c09c71cbecd1746927 (patch) | |
tree | 975c6cd80292a3987ddc06813f980b0280290e38 | |
parent | d52865f0371f7bffe11f935c97265fc60b8fdf77 (diff) | |
download | tekuti-eac799afc38391234acfd0c09c71cbecd1746927.tar.gz tekuti-eac799afc38391234acfd0c09c71cbecd1746927.zip |
Convert the mod-lisp headers to lowercase
HTTP headers are expected to be treated case-insensitively.
-rw-r--r-- | tekuti/mod-lisp.scm | 3 | ||||
-rw-r--r-- | tekuti/page.scm | 2 | ||||
-rw-r--r-- | tekuti/request.scm | 4 |
3 files changed, 5 insertions, 4 deletions
diff --git a/tekuti/mod-lisp.scm b/tekuti/mod-lisp.scm index 458f2bc..f209756 100644 --- a/tekuti/mod-lisp.scm +++ b/tekuti/mod-lisp.scm @@ -45,7 +45,8 @@ (let ((k (read-line*))) (if (string=? k "end") (reverse (map cons keys values)) - (lp (cons k keys) (cons (read-line*) values)))))) + (lp (cons (string-downcase k) keys) + (cons (read-line*) values)))))) (define (read-chars nchars port) (let ((buf (make-string nchars))) diff --git a/tekuti/page.scm b/tekuti/page.scm index 8330bf9..c9fcf7c 100644 --- a/tekuti/page.scm +++ b/tekuti/page.scm @@ -308,7 +308,7 @@ (server-name (request-server-name request))) (cond ((let ((since (assoc-ref (rref request 'headers '()) - "If-Modified-Since"))) + "if-modified-since"))) (and since (>= (rfc822-date->timestamp since) last-modified))) (rcons* request 'status 304 diff --git a/tekuti/request.scm b/tekuti/request.scm index 276691d..08b9adf 100644 --- a/tekuti/request.scm +++ b/tekuti/request.scm @@ -118,7 +118,7 @@ ;; danger here, regarding the optional alternate clauses... (define (request-authenticated? request) (let ((headers (rref request 'headers '()))) - (let ((auth (assoc-ref headers "Authorization"))) + (let ((auth (assoc-ref headers "authorization"))) (and auth (match-bind "^Basic ([A-Za-z0-9+/=]*)$" auth (_ b64) (match-bind "^([^:]*):(.*)$" @@ -193,7 +193,7 @@ (define (request-server-name request) (let ((headers (rref request 'headers))) - (or (assoc-ref headers "Host") + (or (assoc-ref headers "host") (assoc-ref headers "server-ip-addr")))) |