 
         "method" get >upper "REQUEST_METHOD" set
         "raw-query" get "QUERY_STRING" set
+	"Cookie" "header" get at "HTTP_COOKIE" set 
 
         "User-Agent" header-param "HTTP_USER_AGENT" set
         "Accept" header-param "HTTP_ACCEPT" set
 
         post? [
             "Content-Type" header-param "CONTENT_TYPE" set
-            "raw-response" get length "CONTENT_LENGTH" set
+            "raw-response" get length number>string "CONTENT_LENGTH" set
         ] when
     ] H{ } make-assoc ;
 

: cgi-variables ( name -- assoc )
    #! This needs some work.
    [
        "SCRIPT_NAME" set

        "CGI/1.0" "GATEWAY_INTERFACE" set

! See http://factorcode.org/license.txt for BSD license.
USING: namespaces kernel assocs io.files combinators
arrays io.launcher io http.server.responders webapps.file
sequences strings math.parser ;
IN: webapps.cgi

SYMBOL: cgi-root
