úÎ!ë±âk‘      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽNoneŸ @(c) Bjorn Bringert 2004-2005 (c) Ian Lynagh 2005 BSD-styleJohn Chee <cheecheeo@gmail.com> experimentaluportable General server side HTTP cookie library. Based on <http://wp.netscape.com/newsref/std/cookie_spec.html>Safe&¨cgi:Contains all information about a cookie set by the server.cgiName of the cookie.cgiValue of the cookie.cgiExpiry date of the cookie. If ‘Š, the cookie expires when the browser sessions ends. If the date is in the past, the client should delete the cookie immediately.cgi4The domain suffix to which this cookie will be sent.cgi+The path to which this cookie will be sent.cgi’: if this cookie should only be sent using secure means.cgi’Z to tell the client's browser to prevent client side scripts from accessing the cookie.cgiÈConstruct a cookie with only name and value set. This client will expire when the browser sessions ends, will only be sent to the server and path which set it and may be sent using any means.cgi7Get the value of a cookie from a string on the form 7"cookieName1=cookieValue1;...;cookieName2=cookieValue2". This is the format of the Cookie HTTP header. cgi[Delete a cookie from the client by setting the cookie expiry date to a date in the past.!cgiGShow a cookie on the format used as the value of the Set-Cookie header.“cgi»Show a name-value pair. FIXME: if the name or value contains semicolons, this breaks. The problem is that the original cookie spec does not mention how to do escaping or quoting."cgi0Gets all the cookies from a Cookie: header value”cgiReturn ‘H is the list is empty, otherwise return the last element of the list.cgiNamecgiValuecgiCookiecgi Cookie namecgi,Semicolon separated list of name-value pairscgiCookie value, if found cgi5Cookie to delete. The only fields that matter are ,  and “cginamecgivalue"cgiString to parsecgi Cookie name - cookie value pairs !" !"(c) Bjorn Bringert 2006 BSD-styleJohn Chee <cheecheeo@gmail.com> experimental non-portableNoneSÄ'cgiThe result of a CGI program.*cgi3The value of an input parameter, and some metadata./cgiThe input to a CGI action.1cgiEnvironment variables.2cgiNInput parameters. For better laziness in reading inputs, this is not a Map.3cgiÀRaw request body. To avoid memory leaks, this is the empty string if the request body has been interpreted as inputs in "application/x-www-form-urlencoded" or "multipart/form-data" format.4cgiLRuns a CGI action in a given environment. Uses Handles for input and output.5cgiXRuns a CGI action in a given environment. Uses lazy ByteStrings for input and output.6cgiSGets and decodes the input according to the request method and the content-type.•cgi Builds an * object for a simple value.–cgi'The default content-type for variables.7cgiBGets the values of all CGI variables from the program environment.8cgi®Logs some message using the server's logging facility. FIXME: does this have to be more general to support FastCGI etc? Maybe we should store log messages in the CGIState?—cgi"Gets inputs from the query string.˜cgi1Decodes application/x-www-form-urlencoded inputs.9cgi>Formats name-value pairs as application/x-www-form-urlencoded.:cgiJConverts a single value to the application/x-www-form-urlencoded encoding.;cgiFGets the name-value pairs from application/x-www-form-urlencoded data.<cgiOConverts a single value from the application/x-www-form-urlencoded encoding.™cgiEUnescape a percent-encoded string, but doesn't decode UTF-8 encoding.&unEscapeString "Hell%C3%B3 w%C3%B3rld""Hell\195\179 w\195\179rld"šcgi+Gets input variables from the body, if any.›cgiDecodes a POST body.=cgi/Takes the right number of bytes from the input.œcgi"Decodes multipart/form-data input.>cgi=Replaces all instances of a value in a list by another value.cgiSame as žI specialized to strings, but returns the empty string if lookup fails.4cgi%CGI environment variables, e.g. from 7.cgi*Handle that input will be read from, e.g. .cgi,Handle that output will be written to, e.g. .cgi CGI action5cgiCGI environment variables.cgi Request body.cgi CGI action.cgiResponse (headers and content).6cgiCGI environment variables.cgi Request body.cgiVA list of input variables and values, and the request body if it was not interpreted.—cgiCGI environment variables.cgiInput variables and values.˜cgiInput variables and values.=cgiCGI environment variables.cgi Request body.cgidCONTENT_LENGTH bytes from the request body, or the empty string if there is no CONTENT_LENGTH.œcgiContent-type parameterscgi Request bodycgiInput variables and values.>cgiValue to look forcgiValue to replace it withcgi Input listcgi Output list'()*+,-./0123456789:;<=>?/0123*+,-.'()456=789:;<?>(c) Bjorn Bringert 2006 BSD-styleJohn Chee <cheecheeo@gmail.com> experimental non-portableNone@A_3 FcgiÀThe class of CGI monads. Most CGI actions can be run in any monad which is an instance of this class, which means that you can use your own monad transformers to add extra functionality.GcgiAdd a response header.Hcgi#Get something from the CGI request.IcgiThe CGIT monad transformer.Lcgi A simple CGI monad with just IO.McgiRun a CGI action.NcgiDeprecated alias for Ÿ . Please use Ÿ instead.OcgiDeprecated alias for   . Please use   instead.PcgiDeprecated alias for ¡ . Please use ¡ instead.QcgiDeprecated alias for   . Please use   instead./0123FGHIJKLMNOPQFGHIJKLM/0123NOPQ˜(c) The University of Glasgow 2001 (c) Bjorn Bringert 2004-2006 (c) Ian Lynagh 2005 (c) Jeremy Shaw 2005 BSD-styleJohn Chee <cheecheeo@gmail.com> experimental'non-portable (uses Control.Monad.State)Noneßw2\cgi¨Run a CGI action. Typically called by the main function. Reads input from stdin and writes to stdout. Gets CGI environment variables from the program environment.]cgi Output a ¢{. The output is assumed to be text/html, encoded using ISO-8859-1. To change this, set the Content-type header using .^cgi Output a £{. The output is assumed to be text/html, encoded using ISO-8859-1. To change this, set the Content-type header using ._cgi(Do not output anything (except headers).`cgiRedirect to some location.acgiªCatches any exception thrown by the given CGI action, returns an error page with a 500 Internal Server Error, showing the exception information, and logs the error.Typical usage: ZcgiMain :: CGI CGIResult cgiMain = ... main :: IO () main = runCGI (handleErrors cgiMain)bcgi?Output a 500 Internal Server Error with information from an ¤.ccgiOutput an error page to the user, with the given HTTP status code in the response. Also logs the error information using 8.¥cgiCreate an HTML error page.dcgiUse c) to output and log a 404 Not Found error.ecgiUse c2 to output and log a 405 Method Not Allowed error.fcgiUse c/ to output and log a 500 Internal Server Error.gcgi5Get the value of a CGI environment variable. Example: "remoteAddr <- getVar "REMOTE_ADDR"icgi3Get all CGI environment variables and their values.jcgi_The server's hostname, DNS alias, or IP address as it would appear in self-referencing URLs.kcgi.The port number to which the request was sent.lcgi]The method with which the request was made. For HTTP, this is "GET", "HEAD", "POST", etc.mcgißThe extra path information, as given by the client. This is any part of the request path that follows the CGI program path. If the string returned by this function is not empty, it is guaranteed to start with a '/'.ÇNote that this function returns an unencoded string. Make sure to percent-encode any characters that are not allowed in URI paths before using the result of this function to construct a URI. See |, } and ~ for a higher-level interface.ncgiThe path returned by m8, but with virtual-to-physical mapping applied to it.ocgiMA virtual path to the script being executed, used for self-referencing URIs.ÇNote that this function returns an unencoded string. Make sure to percent-encode any characters that are not allowed in URI paths before using the result of this function to construct a URI. See |, } and ~ for a higher-level interface.pcgi™The information which follows the ? in the URL which referenced this program. This is the percent-encoded query information. For most normal uses, - and friends are probably more convenient.qcgipThe hostname making the request. If the server does not have this information, Nothing is returned. See also r.rcgi5The IP address of the remote host making the request.scgi™If the server supports user authentication, and the script is protected, this is the protocol-specific authentication method used to validate the user.tcgi|If the server supports user authentication, and the script is protected, this is the username they have authenticated as.ucgi€For queries which have attached information, such as HTTP POST and PUT, this is the content type of the data. You can use E to get a structured representation of the the content-type value.vcgi„For queries which have attached information, such as HTTP POST and PUT, this is the length of the content given by the client.wcgimGets the value of the request header with the given name. The header name is case-insensitive. Example: requestHeader "User-Agent"|cgiAttempts to reconstruct the absolute URI of this program. This does not include any extra path information or query parameters. See }† for that. If the server is rewriting request URIs, this URI can be different from the one requested by the client. See also ~.ZCharacters in the components of the returned URI are escaped when needed, as required by  Network.URI.}cgiLike |, but the returned ¦à also includes any extra path information, and any query parameters. If the server is rewriting request URIs, this URI can be different from the one requested by the client. See also ~.ZCharacters in the components of the returned URI are escaped when needed, as required by  Network.URI.§cgi8Does percent-encoding as needed for URI path components.~cgiÿ/Attempts to reconstruct the absolute URI requested by the client, including extra path information and query parameters. If no request URI rewriting is done, or if the web server does not provide the information needed to reconstruct the request URI, this function returns the same value as }.ZCharacters in the components of the returned URI are escaped when needed, as required by  Network.URI.cgi‹Get the value of an input variable, for example from a form. If the variable has multiple values, the first one is returned. Example: query <- getInput "query"€cgiLike , but returns a £.cgi³Get all the values of an input variable, for example from a form. This can be used to get all the values from form controls which allow multiple values to be selected. Example: %vals <- getMultiInput "my_checkboxes"‚cgiSame as  but using £s.ƒcgiGet the file name of an input.„cgi•Get the content-type of an input, if the input exists, e.g. "image/jpeg". For non-file inputs, this function returns "text/plain". You can use E to get a structured representation of the the content-type value.…cgiSame as 2, but tries to read the value to the desired type.†cgi“Get the names and values of all inputs. Note: the same name may occur more than once in the output, if there are several values for the name.‡cgi“Get the names and values of all inputs. Note: the same name may occur more than once in the output, if there are several values for the name.ˆcgi%Get the names of all input variables.‰cgi.Get the uninterpreted request body as a StringŠcgi5Get the uninterpreted request body as lazy ByteString‹cgiGet the value of a cookie.ŒcgiSame as ‹2, but tries to read the value to the desired type.cgi Set a cookie.ŽcgiDelete a cookie from the clientcgi"Add a response header. Example: %setHeader "Content-type" "text/plain"cgiSet the HTTP response status.]cgiThe string to output.^cgiThe string to output.`cgiA URL to redirect to.ccgiHTTP Status codecgiStatus messagecgiError information¥cgi Status codecgiStatus messagecgiError information¨cgi Status codecgiStatus messagecgiError informationdcgi#The name of the requested resource.ecgiThe allowed methods.fcgiError information.gcgiThe name of the variable.hcgiThe name of the variable.cgi Default valuecgiThe name of the variable.cgi<The value of the variable, or Nothing, if it was not set.€cgiThe name of the variable.cgi<The value of the variable, or Nothing, if it was not set.cgiThe name of the variable.cgiKThe values of the variable, or the empty list if the variable was not set.‚cgiThe name of the variable.cgiKThe values of the variable, or the empty list if the variable was not set.ƒcgiThe name of the variable.cgi;The file name corresponding to the input, if there is one.„cgiThe name of the variable.cgi(The content type, formatted as a string.…cgiThe name of the variable.cgi‘c if the variable does not exist or if the value could not be interpreted at the desired type.‹cgiThe name of the cookie.cgi‘ if the cookie does not exist.ŒcgiThe name of the cookie.cgi‘a if the cookie does not exist or if the value could not be interpreted at the desired type.cgi Header name.cgi Header value.cgiHTTP status code, e.g. 404cgiHTTP status message, e.g.  "Not Found"^  '89:;<FILNOPQ\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ^FI'L\NOPQa8]^_`cbdef€…‰Š†‡ˆ‚ƒ„ghijklmnopqrstuvw|}~ xyz{ ‹ŒŽ9:;<©            !"#$%&'()*+,-./011234556789:;<=>?@ABCDEFGHIJKLMNNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘'’“ ”•–—˜™š›œžŸ ¡¢£ ¤¥¦§¨¦§©¦§ª «¬­®¯ °±²³´µ¶·¸%cgi-3001.4.0.0-JHFYstZR1nRKJ0ROFOqWBy Network.CGINetwork.CGI.ProtocolNetwork.CGI.CookieNetwork.CGI.MonadNetwork.CGI.Accept System.IOstdinstdoutbaseControl.Monad.IO.ClassliftIOMonadIO&multipart-0.1.3-5tcCPmo02I0E7rm0FfFabONetwork.Multipart.HeadershowContentTypeparseContentTypeHeaders HeaderName ctParameters ctSubtypectType ContentTypeLanguageContentEncodingCharset AcceptableAccept negotiateCookie cookieName cookieValue cookieExpires cookieDomain cookiePath cookieSecurecookieHttpOnly newCookie findCookie deleteCookie showCookie readCookies $fShowCookie $fReadCookie $fEqCookie $fOrdCookie CGIResult CGIOutput CGINothingInput inputValue inputFilenameinputContentType CGIRequestcgiVars cgiInputscgiRequestBodyhRunCGI runCGIEnvFPS decodeInput getCGIVarslogCGI formEncode urlEncode formDecode urlDecode takeInputreplace maybeRead $fShowInput$fShowCGIRequest$fShowCGIResult$fReadCGIResult $fEqCGIResult$fOrdCGIResultMonadCGI cgiAddHeadercgiGetCGITunCGITCGIrunCGITthrowCGIcatchCGItryCGIhandleExceptionCGI$fMonadTransCGIT$fMonadErrorSomeExceptionCGIT$fMonadMaskCGIT$fMonadCatchCGIT$fMonadThrowCGIT $fMonadIOCGIT $fMonadCGIT$fApplicativeCGIT $fFunctorCGIT$fMonadCGICGITrunCGIoutput outputFPS outputNothingredirect handleErrorsoutputException outputErroroutputNotFoundoutputMethodNotAllowedoutputInternalServerErrorgetVargetVarWithDefaultgetVars serverName serverPort requestMethodpathInfopathTranslated scriptName queryString remoteHost remoteAddrauthType remoteUserrequestContentTyperequestContentLength requestHeader requestAcceptrequestAcceptCharsetrequestAcceptEncodingrequestAcceptLanguageprogURIqueryURI requestURIgetInput getInputFPS getMultiInputgetMultiInputFPSgetInputFilenamegetInputContentType readInput getInputs getInputsFPS getInputNamesgetBody getBodyFPS getCookie readCookie setCookie setHeader setStatus GHC.MaybeNothingghc-prim GHC.TypesTrueshowPair maybeLast simpleInputdefaultInputType queryInput formInputunEscapeString bodyInput decodeBodymultipartDecode lookupOrNilGHC.Listlookup'exceptions-0.10.0-KStaZHFhmg9WV0B4Gib1EControl.Monad.CatchthrowMcatchtryGHC.BaseStringbytestring-0.10.8.2Data.ByteString.Lazy.Internal ByteStringGHC.Exception.Type Exception errorPage*network-uri-2.6.1.0-K75fCYvLQE41EntOQ30cqK Network.URIURI escapePath errorText