Îõ³h&B$>“’      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘ Safe-InferredŒ À(c) Bjorn Bringert 2004-2005 (c) Ian Lynagh 2005 BSD-styleJohn Chee  experimentalõportable General server side HTTP cookie library. Based on  Safe-Inferred 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“Ú 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.!cgiÇShow 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 ’È 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  experimental non-portable Safe-Inferredy'cgiThe result of a CGI program.*cgi3The value of an input parameter, and some metadata./cgiThe input to a CGI action.1cgiEnvironment variables.2cgiÎInput 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.4cgiÌRuns a CGI action in a given environment. Uses Handles for input and output.5cgiØRuns a CGI action in a given environment. Uses lazy ByteStrings for input and output.6cgiÓGets 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.7cgiÂGets 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.:cgiÊConverts a single value to the application/x-www-form-urlencoded encoding.;cgiÆGets the name-value pairs from application/x-www-form-urlencoded data.<cgiÏConverts a single value from the application/x-www-form-urlencoded encoding.šcgiÅUnescape 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 ŸÉ 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.cgiÖA 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.cgiäCONTENT_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  experimental non-portable Safe-InferredÄÅÍ 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  experimental'non-portable (uses Control.Monad.State) Safe-Inferred=­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 ._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).acgiRedirect to some location.bcgiª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: ÚcgiMain :: CGI CGIResult cgiMain = ... main :: IO () main = runCGI (handleErrors cgiMain)ccgi?Output a 500 Internal Server Error with information from an ¥.dcgiÿOutput 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.ecgiUse d) to output and log a 404 Not Found error.fcgiUse d2 to output and log a 405 Method Not Allowed error.gcgiUse d/ to output and log a 500 Internal Server Error.hcgi5Get the value of a CGI environment variable. Example: "remoteAddr <- getVar "REMOTE_ADDR"jcgi3Get all CGI environment variables and their values.kcgißThe server's hostname, DNS alias, or IP address as it would appear in self-referencing URLs.lcgi.The port number to which the request was sent.mcgiÝThe method with which the request was made. For HTTP, this is "GET", "HEAD", "POST", etc.ncgiß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.ocgiThe path returned by n8, but with virtual-to-physical mapping applied to it.pcgiÍA 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.qcgi™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.rcgiðThe hostname making the request. If the server does not have this information, Nothing is returned. See also s.scgi5The IP address of the remote host making the request.tcgi™If the server supports user authentication, and the script is protected, this is the protocol-specific authentication method used to validate the user.ucgiüIf the server supports user authentication, and the script is protected, this is the username they have authenticated as.vcgi€For queries which have attached information, such as HTTP POST and PUT, this is the content type of the data. You can use Å to get a structured representation of the the content-type value.wcgi„For queries which have attached information, such as HTTP POST and PUT, this is the length of the content given by the client.xcgiíGets 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 .ÚCharacters 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 .ÚCharacters 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 ~.ÚCharacters 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 Å 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.acgiA URL to redirect to.dcgiHTTP Status codecgiStatus messagecgiError information¦cgi Status codecgiStatus messagecgiError information©cgi Status codecgiStatus messagecgiError informationecgi#The name of the requested resource.fcgiThe allowed methods.gcgiError information.hcgiThe name of the variable.icgiThe name of the variable.cgi Default value€cgiThe name of the variable.cgi?@ABCDEFGHIJKLMNNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’'“” •–—˜™š›œžŸ ¡¢£¤ ¥¦§¨©§¨ª§¨« ¬­®¯° ±²³´µ¶·¸¹$cgi-3001.5.0.1-9bptdDp7DxWzXhh0O9dAB Network.CGINetwork.CGI.ProtocolNetwork.CGI.CookieNetwork.CGI.MonadNetwork.CGI.Accept System.IOstdinstdoutbaseControl.Monad.IO.ClassliftIOMonadIO&multipart-0.2.1-39go4EDqaceJXudqZQH6xpNetwork.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$fShowCGIResult$fReadCGIResult $fEqCGIResult$fOrdCGIResult$fShowCGIRequest $fShowInputMonadCGI cgiAddHeadercgiGetCGITunCGITCGIrunCGITthrowCGIcatchCGItryCGIhandleExceptionCGI$fMonadTransCGIT$fMonadErrorSomeExceptionCGIT$fMonadMaskCGIT$fMonadCatchCGIT$fMonadThrowCGIT $fMonadIOCGIT$fMonadFailCGIT $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.Listlookupexceptions-0.10.4Control.Monad.CatchthrowMcatchtryGHC.BaseStringbytestring-0.11.3.1Data.ByteString.Lazy.Internal ByteStringGHC.Exception.Type Exception errorPage*network-uri-2.6.4.2-HOWkOsJ6iQ9LdZ2sAMVHdr Network.URIURI escapePath errorText