Permalink
Browse files

Clack.Request#env

  • Loading branch information...
1 parent a660284 commit f972b4be821c555fa7e6596369a2cbf440999014 @fukamachi committed Mar 16, 2012
Showing with 14 additions and 4 deletions.
  1. +11 −3 src/core/request.lisp
  2. +3 −1 t/core/request.lisp
View
@@ -32,7 +32,8 @@
:parse-rfc2388-form-data)
(:import-from :clack.util.stream
:ensure-character-input-stream)
- (:export :request-method
+ (:export :env
+ :request-method
:script-name
:path-info
:server-name
@@ -55,7 +56,11 @@
@export
(defclass <request> ()
- ((request-method :type keyword
+ ((env :type property-list
+ :initarg :env
+ :reader env
+ :documentation "Raw env")
+ (request-method :type keyword
:initarg :request-method
:reader request-method
:documentation "The HTTP request method.
@@ -136,7 +141,10 @@ Typically this will be something like :HTTP/1.0 or :HTTP/1.1.")
:initform nil))
(:documentation "Portable HTTP Request object for Clack Request."))
-(defmethod initialize-instance :after ((this <request>) &key)
+(defmethod initialize-instance :after ((this <request>) &rest env)
+ (remf env :allow-other-keys)
+ (setf (slot-value this 'env) env)
+
;; cookies
(swhen (slot-value this 'http-cookie)
(setf it (parameters->plist it :delimiter "\\s*[,;]\\s*")))
View
@@ -24,7 +24,9 @@
#(110 97 109 101 61 230 183 177 231 148 186 232 139 177 229 164 170 233 131 142))
:external-format :utf-8))))
-(plan 17)
+(plan 18)
+
+(ok (env req) "env")
(is (content-type req)
"application/x-www-form-urlencoded; charset=utf-8"

0 comments on commit f972b4b

Please sign in to comment.