úÎ!üōĢ”      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“None@AŪ @(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@A%{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Č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-portableNone2@AR¯'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-portableNone2@Aaž 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.NcgiDThrow an exception in a CGI monad. The monad is required to be a ĸ, so that we can use Ŗ to guarantee ordering.OcgipCatches any expection thrown by a CGI action, and uses the given exception handler if an exception is thrown.PcgiŒCatches any exception thrown by an CGI action, and returns either the exception, or if no exception was raised, the result of the action.QcgiDeprecated version of O. Use O 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@Aoģ\cgi–Compatibility wrapper for the old CGI interface. Output the output from a function from CGI environment and input variables to an HTML document.]cgi€Compatibility wrapper for the old CGI interface. Runs a simple CGI server. Note: if using Windows, you might need to wrap   around main.^cgi/Note: if using Windows, you might need to wrap   around main.¤cgisReturns the query string, or the request body if it is a POST request, or the empty string if there is an error.]cgiThe port to run the server on.¤cgiCGI environment variables.cgi Request body.cgi Query string. \]^ \]^˜(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@Aī¯2_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 ’.acgi Output a Ļ{. The output is assumed to be text/html, encoded using ISO-8859-1. To change this, set the Content-type header using ’.bcgi(Do not output anything (except headers).ccgiRedirect to some location.dcgiĒ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)ecgi?Output a 500 Internal Server Error with information from an §.fcgiOutput 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.gcgiUse f) to output and log a 404 Not Found error.hcgiUse f2 to output and log a 405 Method Not Allowed error.icgiUse f/ to output and log a 500 Internal Server Error.jcgi5Get the value of a CGI environment variable. Example: "remoteAddr <- getVar "REMOTE_ADDR"lcgi3Get all CGI environment variables and their values.mcgi_The server's hostname, DNS alias, or IP address as it would appear in self-referencing URLs.ncgi.The port number to which the request was sent.ocgi]The method with which the request was made. For HTTP, this is "GET", "HEAD", "POST", etc.pcgiß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.qcgiThe path returned by p8, but with virtual-to-physical mapping applied to it.rcgiMA 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.scgi™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.tcgipThe hostname making the request. If the server does not have this information, Nothing is returned. See also u.ucgi5The IP address of the remote host making the request.vcgi™If the server supports user authentication, and the script is protected, this is the protocol-specific authentication method used to validate the user.wcgi|If the server supports user authentication, and the script is protected, this is the username they have authenticated as.xcgi€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.ycgi„For queries which have attached information, such as HTTP POST and PUT, this is the length of the content given by the client.zcgimGets the value of the request header with the given name. The header name is case-insensitive. Example: requestHeader "User-Agent"cgiAttempts 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 client’cgi"Add a response header. Example: %setHeader "Content-type" "text/plain"“cgiSet the HTTP response status.`cgiThe string to output.acgiThe string to output.ccgiA URL to redirect to.fcgiHTTP Status codecgiStatus messagecgiError information¨cgi Status codecgiStatus messagecgiError informationĢcgi Status codecgiStatus messagecgiError informationgcgi#The name of the requested resource.hcgiThe allowed methods.icgiError information.jcgiThe name of the variable.kcgiThe name of the variable.cgi Default value‚cgiThe 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"a  '89:;<FILNOPQ\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“]FI'L_NOPQd8`abc’“feghi‚ƒˆŒ‰Š‹„…†‡jklmnopqrstuvwxyz€ {|}~ Ž‘9:;<Ŧ   !"##$%&'()*+,-./01234566789::;<=>?@ABCDEFGHIJKLMNOPQRSSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™,š› œžŸ ĄĸŖ¤Ĩϧ¨ŠĒĢ Ŧ­Ž¯°Ž¯ą˛ ŗ´ĩļˇ ¸šēģŧŊžŋĀ%cgi-3001.3.0.3-EXYg6Qy0PBi1I4ZlAQ9mPK Network.CGINetwork.CGI.ProtocolNetwork.CGI.CompatNetwork.CGI.CookieNetwork.CGI.MonadNetwork.CGI.Accept System.IOstdinstdoutNetwork withSocketsDobaseControl.Monad.IO.ClassliftIOMonadIO&multipart-0.1.3-CnKHprTdy9m6CspiDLDL2MNetwork.Multipart.HeadershowContentTypeparseContentTypeHeaders HeaderName ctParameters ctSubtypectType ContentTypexhtml-3000.2.2.1Text.XHtml.InternalsHtmlLanguageContentEncodingCharset AcceptableAccept negotiateCookie cookieName cookieValue cookieExpires cookieDomain cookiePath cookieSecure 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$fMonadErrorSomeExceptionCGIT$fMonadTransCGIT$fMonadMaskCGIT$fMonadCatchCGIT$fMonadThrowCGIT $fMonadIOCGIT $fMonadCGIT$fApplicativeCGIT $fFunctorCGIT$fMonadCGICGITwrapperpwrapperconnectToCGIScriptrunCGIoutput 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.Catch MonadThrowthrowMgetRequestInputGHC.BaseStringbytestring-0.10.8.2Data.ByteString.Lazy.Internal ByteStringGHC.Exception.Type Exception errorPage*network-uri-2.6.1.0-K75fCYvLQE41EntOQ30cqK Network.URIURI escapePath errorText