^      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                             !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~'Ealternative implementation of accept to work around EAI_AGAIN errors  non-portable (not tested) experimentalbjorn@bringert.netAllows stream logging.  Refer to  below. ?Streams should make layering of TLS protocol easier in future,  they allow reading/$writing to files etc for debugging, + they allow use of protocols other than TCP/IP  and they allow customisation. (Instances of this class should not trim - the input in any way, e.g. leave LF on line 3 endings etc. Unless that is exactly the behaviour ) you want from your twisted instances ;) >This is the type returned by many exported network functions. Wraps a stream with logging I/ O, the first 7 argument is a filename which is opened in AppendMode. non-portable (not tested) experimentalbjorn@bringert.net The 4 object allows input buffering, and maintenance of  some admin-type data. The - newtype is a wrapper that allows us to make ( connections an instance of the StreamIn/%Out classes, without ghc extensions. D While this looks sort of like a generic reference to the transport = layer it is actually TCP specific, which can be seen in the  implementation of the 'Stream Connection' instance. /Open a connection to port 80 on a remote host. 3This function establishes a connection to a remote  host, it uses  getHostByName which interrogates the 5 DNS system, hence may trigger a network connection. Add a  persistant) option? Current persistant is default.  Use Result+ type for synchronous exception reporting? 4Checks both that the underlying Socket is connected 0 and that the connection peer matches the given ( host name (which is recorded locally).  non-portable (not tested) experimentalbjorn@bringert.net{An HTTP Response.  The : instance of this type is used for message serialisation, B which means no body data is output, additionally the output will D show an HTTP version of 1.1 instead of the actual version returned  by a server. An HTTP Request.  The : instance of this type is used for message serialisation, % which means no body data is output. might need changing in future  1) to support  uri in OPTIONS request + 2) transparent support for both relative  &% absolute uris, although this should  already work (leave scheme & host parts empty). +The HTTP request method, to be used in the  object. = We are missing a few of the stranger methods, but these are - not really necessary until we add full TLS. DThis class allows us to write generic header manipulation functions  for both  and  data types. HTTP Header Name type: 0 Why include this at all? I have some reasons / 1) prevent spelling errors of header names, 5 2) remind everyone of what headers are available, 4 3) might speed up searches for specific headers. Arguments against: / 1) makes customising header names laborious  2) increases code volume. 1Allows for unrecognised or experimental headers.    (The Header data type pairs header names & values.   0Inserts a header with the given name and value.  Allows duplicate header names. 6Adds the new header only if no previous header shares  the same name. )Removes old headers with duplicate name. Inserts multiple headers. )Gets a list of headers with a particular . <Lookup presence of specific HeaderName in a list of Headers 3 Returns the value from the first matching header.  !"ASimple way to get a resource across a non-persistant connection.  Headers that may be altered: > Host Altered only if no Host header is supplied, HTTP/1.1 & requires a Host header. D Connection Where no allowance is made for persistant connections 3 the Connection header will be set to close #Like "*, but acting on an already opened stream. $2this is not the most graceful of implementations. . The problem is that Network.URI.authority is 6 deprecated. And we want to use Network.URI.URIAuth. So this method use to parse a host field as a URI 0 auth, which is not stictly correct. We still  fake that behavior here. %&'HReceive and parse a HTTP request from the given Stream. Should be used ! for server side interactions. (HVery simple function, send a HTTP response over the given stream. This 9 could be improved on to use different transfer types. )4Used when we know exactly how many bytes to expect. *'Used when nothing about data is known, . Unfortunately waiting for a socket closure ' causes bad behaviour. Here we just ( take data once and give up the rest. +A necessary feature of HTTP/1.1 , Also the only transfer variety likely to  return any footers. ,-2Maybe in the future we will have a sensible thing 4 to do here, at that time we might want to change  the name. .DRemove leading crlfs then call readTillEmpty2 (not required by RFC) /'Read lines until an empty line (CRLF), - also accepts a connection close as end of  input, which is not an HTTP/1.1 compliant * thing to do - so probably indicates an  error condition. 012w    "#%&'(012Z2       "#%&'(012 3456789:;<=49:;<=49:;<=>?@ABCDEportable experimental lemmih@vo.com)FGHI A MIME media type value.  The $ instance is derived automatically.  Use J to obtain the standard  string representation.  See  #http://www.ietf.org/rfc/rfc2046.txt for more ' information about MIME media types. +The top-level media type, the general type $ of the data. Common examples are  "text", "image", "audio", "video",  " multipart", and " application". -The media subtype, the specific data format.  Examples include "plain", "html",  "jpeg", " form-data", etc. ,Media type parameters. On common example is ! the charset parameter for the "text"  top-level type, e.g. ("charset"," ISO-8859-1"). KLMNOPQJ>Produce the standard string representation of a content-type,  e.g. "text/html; charset=ISO-8859-1". RS5Parse the standard representation of a content-type. 6 If the input cannot be parsed, this function calls  T/ with a (hopefully) informative error message. UVWXYZ[\]^RFC 822 LWSP-char _`#RFC 822 CRLF (but more permissive) a One line bcdefghijFGHI KLMNJSUWXZ[\FGGHII  KLMNJSUWXZ[\4Convenience class for converting data types to URIs *Retrieves the path component from the URI +Retrieves the query component from the URI ,Retrieves the scheme component from the URI EModifies the scheme component of the URI using the provided function CModifies the path component of the URI using the provided function %Sets the scheme component of the URI #Sets the path component of the URI $Returns true if the URI is absolute /Render should be used for prettyprinting URIs. 9Parses a URI from a String. Returns Nothing on failure.    klmnopqrstuostuostu!"Connected socket Data received #$!"#$!"#$!"#$%"Specify the lifetime of a cookie. @Note that we always set the max-age and expires headers because < internet explorer does not honor max-age. You can specific (  or '8 and the other will be calculated for you. Choose which # ever one makes your life easiest. &cookie already expired 'cookie expiration date (life time of cookie in seconds )0session cookie - expires when browser is closed */a type for HTTP cookies. Usually created using 4. +,-./01234>Creates a cookie with a default version of 1, empty domain, a  path of /(, secure == False and httpOnly == False  see also:  addCookie  cookie name  cookie value 5Set a Cookie in the Result. ? The values are escaped as per RFC 2109, but some browsers may 0 have buggy support for cookies containing e.g. '"' or ' '. AAlso, it seems that chrome, safari, and other webkit browsers do A not like cookies which have double quotes around the domain and  reject/6ignore the cookie. So, we no longer quote the domain. Ainternet explorer does not honor the max-age directive so we set  both max-age and expires. See % and 3% for a convenient way of calculating & the first argument to this function. v69Not an supported api. Takes a cookie header and returns = either a String error message or an array of parsed cookies 74not a supported api. A parser for RFC 2109 cookies 8LGet all cookies from the HTTP request. The cookies are ordered per RFC from I the most specific to the least specific. Multiple cookies with the same  name are allowed to exist. 9LGet the most specific cookie with the given name. Fails if there is no such F cookie or if the browser did not escape cookies in a proper fashion. @ Browser support for escaping cookies properly is very diverse. :;w%&'()*+,-./0123456789:;*+,-./012%)('&34589:;67%)('&&'()*+,-./012+,-./0123456789:;d<The body of an HTTP @? =>x9a class for working with types that contain HTTP headers ymodify the headers zextract the headers ?an HTTP request @ABCDEFGHIJKLan HTTP Response MNfile handle to send from Ooffset to start at Pnumber of bytes to send QRSTUVW hostname & port (hostname, port) Xa value extract from the  QUERY_STRING or @? body UIf the input value was a file, then it will be saved to a temporary file on disk and Z will contain Left pathToTempFile. YZ[\] Result flags ^_`A flag value set in the QL which controls how the  Content-Length- header is set, and whether *chunked* output  encoding is used.  see also: ~, notContentLength, and  a do not set Content-Length or chunked output encoding. b do not add a Content-Length header. Do use chunked output encoding cautomatically add a Content-Length header to the QL dCombined headers. a Map of HTTP headers 1the Map key is the header converted to lowercase %lowercased name -> (realname, value) ean HTTP header fg header name hJheader value (or values if multiple occurances of the header are present) iClog access requests using hslogger and apache-style log formatting  see also: sr HTTP request method jklmnopqrHTTP configuration st"Port for the server to listen on. u-a function to validate the output on-the-fly v+function to log access requests (see also: {) w<number of seconds to wait before killing an inactive thread x HTTP version yz| if @? is HTTP version 1.1 {| if @? is HTTP version 1.0 |?Should the connection be used for further messages after this.  | isHTTP1_0 && hasKeepAlive || isHTTP1_1 && hasNotConnectionClose }HDefault configuration contains no validator and the port is set to 8000 ~#Default RsFlags: automatically use Transfer-Encoding: Chunked. 7Do not automatically add a Content-Length field to the QL bDo not automatically add a Content-Length header. Do automatically use Transfer-Encoding: Chunked QAutomatically add a Content-Length header. Do not use Transfer-Encoding: Chunked Bget the request body from the Request and replace it with Nothing CIMPORTANT: You can really only call this function once. Subsequent  calls will return }. read the request body inputs dThis will only work if the body inputs have already been decoded. Otherwise it will return Nothing. DConverts a Request into a String representing the corresponding URL LSets the Response status code to the provided Int and lifts the computation  into a Monad. CTakes a list of (key,val) pairs and converts it into Headers. The % keys will be converted to lowercase .Lookup header value. Key is case-insensitive. ;Lookup header value. Key is a case-insensitive bytestring. JLookup header value with a case-sensitive key. The key must be lowercase. ~DLookup header with a case-sensitive key. The key must be lowercase. HReturns True if the associated key is found in the Headers. The lookup  is case insensitive. Acts as  with ByteStrings Acts as . but the key is case sensitive. It should be  in lowercase. Associates the key/1value pair in the headers. Forces the key to be  lowercase. Acts as  but with ByteStrings. ISets the key to the HeaderPair. This is the only way to associate a key L with multiple values via the setHeader* functions. Does not force the key _ to be in lowercase or guarantee that the given key and the key in the HeaderPair will match.  Add a key/:value pair to the header. If the key already has a value 8 associated with it, then the value will be appended. ! Forces the key to be lowercase. )Acts as addHeader except for ByteStrings  Add a key/>value pair to the header using the underlying HeaderPair data } type. Does not force the key to be in lowercase or guarantee that the given key and the key in the HeaderPair will match. JCreates a Response with the given Int as the status code and the provided % String as the body of the Response Acts as & but works with ByteStrings directly. 4By default, Transfer-Encoding: chunked will be used Sets the Response'>s status code to the given Int and redirects to the given URI  Location close  Connection  Keep-Alive_ <=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~c?@ABCDEFGHIJKLQMRSTUVRSTVNOP<=>XYZ[\efghrstuvw}{z]^_~xy`cbaiqponmlkjd|W Z<=>=>? @ABCDEFGHIJK@ABCDEFGHIJKLQMRSTUVRSTVNOPMNOPQRSTUVWXYZ[\YZ[\]^_^_`cbaabcdefghfghiqponmlkjjklmnopqrstuvwstuvwxyyz{|}~!$tempdir quota filename of field content to save (truncated?, saved bytes, saved filename  headers body similar to the normal d function, except the predicate gets the whole rest of the lazy bytestring, not just one character. +TODO: this function has not been profiled. %Packs a string into an Input of type  text/plain (The default content-type for variables. :Check whether a string starts with two dashes followed by  the given boundary string. )The boundary, without the initial dashes 0Checks whether a string starts with two dashes. ;Split a string at the first CRLF. The CRLF is not included # in any of the returned strings. String to split. Returns } if there is no CRLF. %$Like & except Strings and Chars not quoted. see  )maximum bytes for files uploaded in this @? -maximum bytes for all non-file values in the @? body )maximum bytes of overhead for headers in  multipart/ form-data  create a  for use with decodeBody %temporary directory for file uploads )maximum bytes for files uploaded in this @? -maximum bytes for all non-file values in the @? body )maximum bytes of overhead for headers in  multipart/ form-data Decodes application/$x-www-form-urlencoded inputs.  TODO: should any of the [] be error conditions? Decodes multipart/form-data input. Content-type parameters  Request body Input variables and values. 'Get the path components from a String. "&=Unserializes the bytestring into a response. If there is an  error it will return Left msg. +Serializes the request to the given handle #@IP address to listen on (must be an IP address not a host name) port number to listen on Bind and listen port &Use a previously bind port and listen f <=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ @Sends the serialized request to the host defined in the request . and attempts to parse response upon arrival. $_ <=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~c?@ABCDEFGHIJKLQMRSTUVRSTVNOP<=>XYZ[\efghrstuvw}{z]^_~xy`cbaiqponmlkjd|W .1 provides a means to end the current computation  and return a L immediately. This provides an ? alternate escape route. In particular it has a monadic value # of any type. And unless you call   first your , response filters will be applied normally. Extremely useful when you'"re deep inside a monad and decide > that you want to return a completely different content type,  since it doesn'0t force you to convert all your return types to  L! early just to accommodate this.  see also:  and  value to return (For , a will always be the type L) ! is almost exclusively used with  . If you  are not using # then you do not need to wrap your D head around this type. If you are -- the type is not as complex as  it first appears. 1It is worth discussing the unpacked structure of  a bit as  it' s exposed in  and . A fully unpacked " has a structure that looks like:  J ununWebT $ WebT m a :: m (Maybe (Either Response a, FilterFun Response))  So, ignoring m, as it is just the containing , the  outermost layer is a  . This is } if  was  called or  ( L a,  (  L)) if  wasn't called. Inside the , there D is a pair. The second element of the pair is our filter function   L.  L is a type  alias for  ( ( L)) . This is  just a wrapper for a L -> L function with a  particular  behavior. The value   Append (Dual (Endo f)) Causes f* to be composed with the previous filter.   Set (Dual (Endo f)) Causes f. to not be composed with the previous filter. 1Finally, the first element of the pair is either   L or  a. AAnother way of looking at all these pieces is from the behaviors  they control. The  controls the  behavior.   ( f) comes from the  behavior. Likewise,   ( f) is from .   L is what you get when you call  and   a is the normal exit. &An example case statement looks like:  ex1 webt = do  val <- ununWebT webt  case val of N Nothing -> Nothing -- this is the interior value when mzero was used a Just (Left r, f) -> Just (Left r, f) -- r is the value that was passed into "finishWith" I -- f is our filter function P Just (Right a, f) -> Just (Right a, f) -- a is our normal monadic value Q -- f is still our filter function  The basic L building object. /A set of functions for manipulating filters.  implements  L so these methods * are the fundamental ways of manipulating L values. 0Ignores all previous alterations to your filter As an example:   do  composeFilter f  setFilter g  return "Hello World" The  g will cause the first  f to  be ignored. 7Composes your filter function with the existing filter  function. +Retrieves the filter from the environment.  is a lot more fun to type than  (  ( a)). "A monoid operation container. If a is a monoid, then  + is a monoid with the following behaviors:  7 Set x `mappend` Append y = Set (x `mappend` y) 7 Append x `mappend` Append y = Append (x `mappend` y) & _ `mappend` Set y = Set y :A simple way of summarizing this is, if the right side is , ? then the right is appended to the left. If the right side is  !, then the left side is ignored. The / class provides methods for reading or locally  modifying the ?-. It is essentially a specialized version of  the $ class. Providing the unique names,  and   makes it easier to use  and   together. 3 is a rich, featureful monad for web development.  see also:  simpleHTTP, , , , and  HasRqData  An alias for    An alias for  when using . 'Particularly useful when combined with runWebT to produce  a m ( L) from a ?. )function for lifting WebT to ServerPartT ANOTE: This is mostly for internal use. If you want to access the  ? in user-code see  from .  do request <- askRq  ... A constructor for a  when you don't care about the request. DNOTE: This is mostly for internal use. If you think you need to use D it in your own code, you might consider asking on the mailing list 9 or IRC to find out if there is an alternative solution. 1Apply a function to transform the inner monad of   m. *Often used when transforming a monad with , since   simpleHTTP requires a   a . Refer to  3 for an explanation of the structure of the monad. 2Here is an example. Suppose you want to embed an  into your   to enable  and  in your .  7 type MyServerPartT e m a = ServerPartT (ErrorT e m) a Now suppose you want to pass  MyServerPartT into a function that  demands a   a (e.g.  simpleHTTP ). You can  provide the function:  L unpackErrorT :: (Monad m, Show e) => UnWebT (ErrorT e m) a -> UnWebT m a  unpackErrorT et = do  eitherV <- runErrorT et  return $ case eitherV of 1 Left err -> Just (Left $ toResponse $ G "Catastrophic failure " ++ show err @ , filterFun $ \r -> r{rsCode = 500})  Right x -> x With  unpackErrorT you can now call  simpleHTTP. Just wrap your   list.  T simpleHTTP nullConf $ mapServerPartT unpackErrorT (myPart `catchError` myHandler) Or alternatively:  D simpleHTTP' unpackErrorT nullConf (myPart `catchError` myHandler)  Also see %Happstack.Server.Error.spUnwrapErrorT* for a more sophisticated version of this  function.  A variant of % where the first argument also takes  a ?. Useful if you want to  on a different   inside your monad (see spUnwrapErrorT). Extract the value from a .  Note that a  is actually a  CoPointed from:   hhttp://hackage.haskell.org/packages/archive/category-extras/latest/doc/html/Control-Functor-Pointed.html . But lets not drag in that dependency. yet... turn a function into a . Primarily used with  &Resets all your filters. An alias for  . 8Used to ignore all your filters and immediately end the  computation. A combination of  and . An alternate form of % that can be easily used within a do  block. %For when you really need to unpack a  entirely (and not " just unwrap the first layer with ). For wrapping a  back up.  .  =  See $ for a discussion of this function. 'This is kinda like a very oddly shaped  or . . You probably want one or the other of those. Deprecated: use . !What is this for, exactly? I don't understand why Show a is E even in the context Deprecated: This function appears to do nothing ( at all. If it use it, let us know why. ... Add the +* to L. example   main = simpleHTTP nullConf $ 2 do addCookie Session (mkCookie "name" "value") , ok $ "You now have a session cookie."  see also:   Add the list +* to the L.  see also:  @Expire the named cookie immediately and set the cookie value to ""  main = simpleHTTP nullConf $  do expireCookie "name" * ok $ "The cookie has been expired." %&'()*+,-./0124*+,-./012%)('&4  will convert a value into a QL body,  set the  content-type3, and set the default response code for that type.  Example:  9 main = simpleHTTP nullConf $ toResponse "hello, world!" will generate a QL with the content-type text/plain,  the response code 200 OK, and the body:  hello, world!.  simpleHTTP will call 2 automatically, so the above can be shortened to:  . main = simpleHTTP nullConf $ "hello, world!" Minimal definition:  (and usually ).  A low-level function to build a QL from a content-type  and a  ByteString.  Creates a QL in a manner similar to the  class, 0 but without requiring an instance declaration.  example:  # import Data.ByteString.Char8 as C ( import Data.ByteString.Lazy.Char8 as L  import Happstack.Server  ^ main = simpleHTTP nullConf $ ok $ toResponseBS (C.pack "text/plain") (L.pack "hello, world") (note: C.pack and @ only work for ascii. For unicode strings you would need to use  utf8-string, text), or something similar to create a valid  ByteString).  content-type response body  alias for: fmap toResponse turns m a into m QL using . @ main = simpleHTTP nullConf $ flatten $ do return "flatten me."  Honor an if-modified-since header in a @?.  If the @? includes the if-modified-since header and the  QL8 has not been modified, then return 304 (Not Modified),  otherwise return the QL. mod-time for the QL (MUST NOT be later than server's time of message origination) 7incoming request (used to check for if-modified-since) ,Response to send if there are modifications Deprecated: use . /Set an arbitrary return code in your response. AA filter for setting the response code. Generally you will use a  helper function like  or .  5 main = simpleHTTP nullConf $ do setResponseCode 200 ; return "Everything is OK"  see also:  response code Same as  status >> return val. BUse this if you want to set a response code that does not already  have a helper function. : main = simpleHTTP nullConf $ resp 200 "Everything is OK" response code value to return  Respond with 200 OK. 4 main = simpleHTTP nullConf $ ok "Everything is OK"  Respond with 204 No Content A 204 No Contentb response may not contain a message-body. If you try to supply one, it will be dutifully ignored. @ main = simpleHTTP nullConf $ noContent "This will be ignored."  Respond with 500 Internal Server Error. _ main = simpleHTTP nullConf $ internalServerError "Sorry, there was an internal server error." Responds with 502 Bad Gateway. 8 main = simpleHTTP nullConf $ badGateway "Bad Gateway."  Respond with 400 Bad Request. 8 main = simpleHTTP nullConf $ badRequest "Bad Request."  Respond with 401 Unauthorized. E main = simpleHTTP nullConf $ unauthorized "You are not authorized."  Respond with  403 Forbidden. B main = simpleHTTP nullConf $ forbidden "Sorry, it is forbidden."  Respond with  404 Not Found. V main = simpleHTTP nullConf $ notFound "What you are looking for has not been found."  Respond with 413 Request Entity Too Large. W main = simpleHTTP nullConf $ requestEntityTooLarge "That's too big for me to handle."  Respond with  303 See Other.  v main = simpleHTTP nullConf $ seeOther "http://example.org/" "What you are looking for is now at http://example.org/" NOTE: The second argument of U is the message body which will sent to the browser. According to the HTTP 1.1 spec,  dthe entity of the response SHOULD contain a short hypertext note with a hyperlink to the new URI(s).This is because pre-HTTP/S1.1 user agents do not support 303. However, in practice you can probably just use "" as the second argument.  Respond with  302 Found. You probably want k. This method is not in popular use anymore, and is generally treated like 303 by most user-agents anyway.  Respond with 301 Moved Permanently. ~ main = simpleHTTP nullConf $ movedPermanently "http://example.org/" "What you are looking for is now at http://example.org/"  Respond with 307 Temporary Redirect.  main = simpleHTTP nullConf $ tempRedirect "http://example.org/" "What you are looking for is temporarily at http://example.org/"  4Used by  and . Make your preferred data  type an instance of  to use those functions. #A class for monads which contain a   lift some  into  3An applicative functor and monad for looking up key/ value pairs 1 in the QUERY_STRING, Request body, and cookies. @the environment used to lookup query parameters. It consists of ? the triple: (query string inputs, body inputs, cookie inputs) a list of errors apply 'RqData a' to a   see also: , , , , ,  transform the result of 'RqData a'. This is similar to ) except it also allows you to modify the   not just a. use  to convert a  to a value of type a  % look "key" `checkRq` (readRq "key")  use with  ,name of key (only used for error reporting)  to   on error,  on success convert or validate a value This is similar to & except that the function can fail by C returning Left and an error message. The error will be propagated  by calling . :This function is useful for a number of things including:   Parsing a  into another type _ Checking that a value meets some requirements (for example, that is an Int between 1 and 10). Example usage at:  ?http://happstack.com/docs/crashcourse/RqData.html#rqdatacheckrq like ' but the check function can be monadic  similar to Data.List.lookup, but returns all matches not just the first .Gets the first matching named input parameter 8Searches the QUERY_STRING followed by the Request body.  see also:  /Gets all matches for the named input parameter 8Searches the QUERY_STRING followed by the Request body.  see also:  8Gets the first matching named input parameter as a lazy  ByteString 8Searches the QUERY_STRING followed by the Request body.  see also:  7Gets all matches for the named input parameter as lazy  ByteStrings 8Searches the QUERY_STRING followed by the Request body.  see also:  3Gets the first matching named input parameter as a  8Searches the QUERY_STRING followed by the Request body. ?This function assumes the underlying octets are UTF-8 encoded.  Example:   handler :: ServerPart Response  handler =  do foo <- look "foo" + ok $ toResponse $ "foo = " ++ foo  see also:  , , and   2Gets all matches for the named input parameter as s 8Searches the QUERY_STRING followed by the Request body. ?This function assumes the underlying octets are UTF-8 encoded.  see also:  and   8Gets the first matching named input parameter as a lazy  8Searches the QUERY_STRING followed by the Request body. ?This function assumes the underlying octets are UTF-8 encoded.  see also:  , ,  , , and   7Gets all matches for the named input parameter as lazy s 8Searches the QUERY_STRING followed by the Request body. ?This function assumes the underlying octets are UTF-8 encoded.  see also:  ,   and   Gets the named cookie % the cookie name is case insensitive  "gets the named cookie as a string 1gets the named cookie as the requested Read type CGets the first matching named input parameter and decodes it using  8Searches the QUERY_STRING followed by the Request body. ?This function assumes the underlying octets are UTF-8 encoded.  see also:  FGets all matches for the named input parameter and decodes them using  8Searches the QUERY_STRING followed by the Request body. ?This function assumes the underlying octets are UTF-8 encoded.  see also:  #Gets the first matching named file BFiles can only appear in the request body. Additionally, the form  must set enctype=" multipart/ form-data". -This function returns a tuple consisting of:  - The temporary location of the uploaded file , The local filename supplied by the browser * The content-type supplied by the browser DNOTE: You must move the file from the temporary location before the  L8 is sent. The temporary files are automatically removed  after the L is sent. "name of input field to search for <(temporary file location, uploaded file name, content-type) 6gets all the input parameters, and converts them to a  BThe results will contain the QUERY_STRING followed by the Request  body. ?This function assumes the underlying octets are UTF-8 encoded.  see also:  gets all the input parameters BThe results will contain the QUERY_STRING followed by the Request  body.  see also:  The POST/8PUT body of a Request is not received or decoded unless  this function is invoked. :It is an error to try to use the look functions for a POST/PUT / request with out first calling this function. It is ok to call $ at the beginning of every request:   main = simpleHTTP nullConf $ D do decodeBody (defaultBodyPolicy "/tmp/" 4096 4096 4096)  handlers 4You can achieve finer granularity quotas by calling  . with different values in different handlers. Only the first call to  will have any effect. Calling = it a second time, even with different quota values, will do  nothing. run  in a . Example: a simple GET or POST variable based authentication % guard. It handles the request with  errorHandler if  authentication fails.  U data AuthCredentials = AuthCredentials { username :: String, password :: String }  % isValid :: AuthCredentials -> Bool  isValid = const True  % myRqData :: RqData AuthCredentials  myRqData = do ! username <- look "username" ! password <- look "password" 0 return (AuthCredentials username password)  F checkAuth :: (String -> ServerPart Response) -> ServerPart Response  checkAuth errorHandler = do  d <- getDataFn myRqData  case d of . (Left e) -> errorHandler (unlines e) ( (Right a) | isValid a -> mzero 9 (Right a) | otherwise -> errorHandler "invalid" NOTE: you must call # prior to calling this function if $ the request method is POST or PUT.  monad to evaluate return  errors or  a  similar to +, except it calls a sub-handler on success  or  on failure. NOTE: you must call # prior to calling this function if $ the request method is POST or PUT.  A variant of  that uses  to chose your   for you. The example from  becomes:  U data AuthCredentials = AuthCredentials { username :: String, password :: String }  % isValid :: AuthCredentials -> Bool  isValid = const True  % myRqData :: RqData AuthCredentials  myRqData = do ! username <- look "username" ! password <- look "password" 0 return (AuthCredentials username password)  * instance FromData AuthCredentials where  fromData = myRqData  F checkAuth :: (String -> ServerPart Response) -> ServerPart Response  checkAuth errorHandler = do  d <- getData  case d of . (Left e) -> errorHandler (unlines e) ( (Right a) | isValid a -> mzero 9 (Right a) | otherwise -> errorHandler "invalid" NOTE: you must call # prior to calling this function if $ the request method is POST or PUT.  similar to , except it calls a subhandler on success or  on failure. NOTE: you must call # prior to calling this function if $ the request method is POST or PUT. $limit the scope to the Request body  handler :: ServerPart Response  handler = ! do foo <- body $ look "foo" * ok $ toResponse $ "foo = " ++ foo $limit the scope to the QUERY_STRING  handler :: ServerPart Response  handler = ( do foo <- queryString $ look "foo" * ok $ toResponse $ "foo = " ++ foo -     -     &     CA class alias for all the classes a standard server monad (such as t) is expected to have instances for. This allows you to keep your type signatures shorter and easier to understand. !Get a header out of the request. ?Add headers into the response. This method does not overwrite 6 any existing header of the same name, hence the name . % If you want to replace a header use . ?Set a header into the response. This will replace an existing  header of the same name. Use  if you want to add more # than one header of the same name. Run an  action and, if it returns , pass it to the  second argument.  9A variant of require that can run in any monad, not just .    !*A simple HTTP basic authentication guard. -If authentication fails, this part will call .  example:  main = simpleHTTP nullConf $ d msum [ basicAuth "127.0.0.1" (fromList [("happstack","rocks")]) $ ok "You are in the secret club" / , ok "You are not in the secret club."  ] the realm name the username password map the part to guard !!!"Flatten  ( e m) a into a  m  a so that it can be use with  simpleHTTP . Used with  mapServerPartT', e.g.,  h simpleHTTP conf $ mapServerPartT' (spUnWrapErrorT simpleErrorHandler) $ myPart `catchError` errorPart Note that in this example, simpleErrorHandler will only be run if  errorPart" throws an error. You can replace simpleErrorHandler% with your own custom error handler.  see also: # #.A simple error handler which can be used with ". <It returns the error message as a plain text message to the B browser. More sophisticated behaviour can be achieved by calling ( your own custom error handler instead.  see also: " $This  ServerPart modifier enables the use of  throwError and   catchError inside the  actions, by adding the  ! monad transformer to the stack. -You can wrap the complete second argument to  simpleHTTP in this  function. DEPRECATED: use " instead. "#$"#$"#$%%3 is for creating a part that acts as a proxy. The  sole argument []" is a list of allowed domains for @ proxying. This matches the domain part of the request and the  wildcard * can be used. E.g.  "*" to match anything.  " *.example.com"% to match anything under example.com  " example.com" to match just example.com 6TODO: annoyingly enough, this method eventually calls escape, so  any headers you set won'+t be used, and the computation immediately  ends. & Take a proxy ? and create a L. Your basic proxy  building block. See (. *TODO: this would be more useful if it didn't call escape D (e.g. it let you modify the response afterwards, or set additional  headers) '-This is a reverse proxy implementation. See ). *TODO: this would be more useful if it didn't call escape, just  like &.  defaultHost 9map to look up hostname mappings. For the reverse proxy the result is a  ServerPartT" that will reverse proxy for you. ()%&'()%&'()%&'()*;Set the validator which should be used for this particular  QL when validation is enabled. CCalling this function does not enable validation. That can only be ( done by enabling the validation in the sr that is passed to   simpleHTTP. >You do not need to call this function if the validator set in  sr does what you want already. Example: (use /$ instead of the default supplied by  ,)  H simpleHTTP validateConf $ ok . setValidator noopValidator =<< htmlPage  See also: ,, ., /,  0. + ServerPart version of *. Example: (Set validator to /) K simpleHTTP validateConf $ setValidatorSP noopValidator (dir "ajax" ... ) ,Extend }$ by enabling validation and setting  . as the default validator for text/html.  Example: 4 simpleHTTP validateConf . anyRequest $ ok htmlPage -%Actually perform the validation on a QL. #Run the validator specified in the QL. If none is provide # use the supplied default instead. =Note: This function will run validation unconditionally. You  probably want * or ,. . Validate text/html content with WDG HTML Validator. 1This function expects the executable to be named validate and it  must be in the default PATH.  See also: *, ,, 0. /#A validator which always succeeds. AUseful for selectively disabling validation. For example, if you @ are sending down HTML fragments to an AJAX application and the 8 default validator only understands complete documents. 0 Validate the QL using an external application. @If the external application returns 0, the original response is D returned unmodified. If the external application returns non-zero,  a QL5 containing the error messages and original response  body is returned instead. DThis function also takes a predicate filter which is applied to the B content-type of the response. The filter will only be applied if  the predicate returns true. ;NOTE: This function requires the use of -threaded to avoid B blocking. However, you probably need that for Happstack anyway.  See also: .. name of executable $arguments to pass to the executable #optional path to working directory )optional environment (otherwise inherit) content-type filter Response to validate *+,-./0*+,-./0*+,-./0+1see U 2345678a ' from file extensions to content-types  example:   myMimeMap :: MimeMap > myMimeMap = Map.fromList [("gz","application/x-gzip"), ... ]  see also: V 9?try to guess the content-type of a file based on its extension  see also: : :?try to guess the content-type of a file based on its extension  defaults to application/octet-stream if no match was found. Useful as an argument to G  see also: 9, G ;9returns a specific content type, completely ignoring the  argument. Use this with G' if you want to explicitly specify the  content-type.  see also: :, G the content-type to return <,a list of common index files. Specifically:  index.html,  index.xml,  index.gif !Typically used as an argument to  serveDiretory. =return a simple File not found 404 page.  Similar to 3 but does not include the extension separator char >Prevents files of the form '.foo' or  'bar/.foo' from being served ?JReturns True if the given String either starts with a . or is of the form  foo/.bar5, e.g. the typical *nix convention for hidden files. @.Use sendFile to send the contents of a Handle content-type string file path for content to send 6mod-time for the handle (MUST NOT be later than server'^s time of message origination), incoming request (used to check for if-modified-since header) offset into Handle number of bytes to send A'Send the contents of a Lazy ByteString content-type string (e.g. "text/plain; charset=utf-8")  lazy bytestring content to send [mod-time for the bytestring, incoming request (used to check for if-modified-since header) offset into the bytestring dnumber of bytes to send (offset + count must be less than or equal to the length of the bytestring) B'Send the contents of a Lazy ByteString content-type string (e.g. "text/plain; charset=utf-8")  lazy bytestring content to send [mod-time for the bytestring, incoming request (used to check for if-modified-since header) offset into the bytestring dnumber of bytes to send (offset + count must be less than or equal to the length of the bytestring) CFSend the specified file with the specified mime-type using sendFile() =NOTE: assumes file exists and is readable by the server. See F. +WARNING: No security checks are performed. content-type string path to file on disk DLSend the specified file with the specified mime-type using lazy ByteStrings =NOTE: assumes file exists and is readable by the server. See F. +WARNING: No security checks are performed. content-type string path to file on disk ENSend the specified file with the specified mime-type using strict ByteStrings =NOTE: assumes file exists and is readable by the server. See F. +WARNING: No security checks are performed. content-type string path to file on disk FServe a single, specified file. The name of the file being served is specified explicity. It is not derived automatically from the ? url.  example 1: 6Serve using sendfile() and the specified content-type  T serveFileUsing filePathSendFile (asContentType "image/jpeg") "/srv/data/image.jpg"  example 2: PServe using a lazy ByteString and the guess the content-type from the extension  Q serveFileUsing filePathLazy (guessContentTypeM mimeTypes) "/srv/data/image.jpg" +WARNING: No security checks are performed.  typically C, D, or E 9function for determining content-type of file. Typically ; or : path to the file to serve GServe a single, specified file. The name of the file being served is specified explicity. It is not derived automatically from the ? url.  example 1: "Serve as a specific content-type:  > serveFile (asContentType "image/jpeg") "/srv/data/image.jpg"  example 2: 4Serve guessing the content-type from the extension:  ? serveFile (guessContentTypeM mimeTypes) "/srv/data/image.jpg" QIf the specified path does not exist or is not a file, this function will return . +WARNING: No security checks are performed. NOTE: alias for F C 9function for determining content-type of file. Typically ; or : path to the file to serve HNServe files from a directory and its subdirectories (parameterizable version) 5Parameterize this function to create functions like, J, K, and L  You supply:  5 a low-level function which takes a content-type and  and generates a Response 7 a function which determines the content-type from the  ' a list of all the default index files ANOTE: unlike fileServe, there are no index files by default. See <. Ufunction which takes a content-type and filepath and generates a response (typically C, D, or E) 2function which returns the mime-type for FilePath  -> [FilePath]J -- ^ index file names, in case the requested path is a directory file/directory to serve IJ:Serve files from a directory and its subdirectories using sendFile. Usage:  2 fileServe ["index.html"] "path/to/files/on/disk" J* does not support directory browsing. See U DEPRECATED: use U instead. Note: The list of index files [" index.html"] is only used to determine what file to show if the user requests a directory. You *do not* need to explicitly list all the files you want to serve. <index file names, in case the requested path is a directory file/directory to serve KOServe files from a directory and its subdirectories (lazy ByteString version). 8WARNING: May leak file handles. You should probably use J instead. <index file names, in case the requested path is a directory file/directory to serve LRServe files from a directory and its subdirectories (strict ByteString version). \WARNING: the entire file will be read into RAM before being served. You should probably use J instead. ;index file names, in case the next argument is a directory file/directory to serve Mattempt to serve index files $list of possible index files (e.g.,  index.html)  see also V ,directory on disk to search for index files NOPQ2try to find an index file, calls mzero on failure usually C )function to calculate mime type, usually : list of index files. See also < directory to search in RSTa function to generate an HTML page showing the contents of a directory on the disk  see also: R, T path to directory on disk list of entries in that path TUa function to generate an HTML table showing the contents of a directory on the disk 3This function generates most of the content of the  S% page. If you want to style the page E differently, or add google analytics code, etc, you can just create / a new page template to wrap around this HTML.  see also: , S list of files+meta data, see  -look up the meta data associated with a file /path to directory on disk containing the entry entry in that directory UJServe files and directories from a directory and its subdirectories using sendFile. Usage:  F serveDirectory EnableBrowsing ["index.html"] "path/to/files/on/disk" @If the requested path does not match a file or directory on the  disk, then U calls . CIf the requested path is a file then the file is served normally. AIf the requested path is a directory, then the result depends on 3 what the first two arguments to the function are. :The first argument controls whether directory browsing is  enabled. 6The second argument is a list of index files (such as  index.html). When a directory is requested, U will first try to E find one of the index files (in the order they are listed). If that , fails, it will show a directory listing if 3 is set,  otherwise it will return  forbidden "Directory index forbidden". ?Here is an explicit list of all the possible outcomes when the " argument is a (valid) directory:  2, empty index file list #This will always return, forbidden "Directory index forbidden"  2, non-empty index file list  - If an index file is found it will be shown.  Otherwise returns, forbidden "Directory index forbidden"  3, empty index file list  Always shows a directory index.  3, non-empty index file list  , If an index file is found it will be shown # Otherwise shows a directory index  see also: <, G allow directory browsing <index file names, in case the requested path is a directory file/directory to serve V'Ready collection of common mime types. I Except for the first two entries, the mappings come from an Ubuntu 8.04 /etc/mime.types file. &123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUV&JHKL132UGF@ABCDE8V;9:4765RST><IQMPNO=?&13223476556789:;<=>?@ABCDEFGHIJKLMNOPQRSTUV% 1238:;<GJUV 132UG8V;:<JWThis class is used by e" to parse a path component into a  value.  The instances for number types (,  , etc) use  to  parse the path component. The instance for !, on the other hand, returns the  unmodified path component. <See the following section of the Happstack Crash Course for + detailed instructions using and extending W:  Fhttp://www.happstack.com/docs/crashcourse/RouteFilters.html#FromReqURI XYBinstances of this class provide a variety of ways to match on the @? method.  Examples + methodM GET -- match GET 3 methodM [HEAD, GET] -- match HEAD or GET @ methodM (not . (==) DELETE) -- match any method except DELETE 2 methodM () -- match any method Z[)Guard using an arbitrary function on the @?. \<Guard against the method. This function also guards against $ *any remaining path segments*. See ] for the version  that guards only by method.  Example:  handler :: ServerPart Response  handler =  do methodM [GET, HEAD]  ... ]-Guard against the method only (as opposed to \).  Example:  handler :: ServerPart Response  handler =  do methodOnly [GET, HEAD]  ... ^BGuard against the method. Note, this function also guards against ) any remaining path segments. Similar to \& but with a different type signature.  Example:  handler :: ServerPart Response - handler = methodSP [GET, HEAD] $ subHandler _FGuard against the method. Note, this function also guards against any  remaining path segments. DEPRECATED: Use ^, \, or ] `Bguard which only succeeds if there are no remaining path segments 8Often used if you want to explicitly assign a route for  aBPop a path element and run the supplied handler if it matches the  given string.   handler :: ServerPart Response . handler = dir "foo" $ dir "bar" $ subHandler !The path element can not contain '/' . See also b. bGuard against a  . Unlike a the  may  contain '/'6. If the guard succeeds, the matched elements will be " popped from the directory stack.   dirs "foo/bar" $ ...  See also: a. cGuard against the host. This matches against the host" header specified in the incoming @?. (Can be used to support virtual hosting,  ,http://en.wikipedia.org/wiki/Virtual_hosting  see also: d d Lookup the host< header in the incoming request and pass it to the handler.  see also: c e*Pop a path element and parse it using the X in the  W class. f>Grab the rest of the URL (dirs + query) and passes it to your  handler. g*Pop any path element and run the handler. PSucceeds if a path component was popped. Fails is the remaining path was empty. h0Guard which checks that the Request URI ends in '/' . Useful  for distinguishing between foo and foo/ WXYZ[\]^_`abcdefgh\]^_YZab`hgWXefcd[WXXYZZ[\]^_`abcdefgh requires mtl provisional'Happstack team <happs@googlegroups.com>  An array of %, useful for processing command line  options into an sr for j. i"Parse command line options into a sr. j9start the server, and handle requests using the supplied  . AThis function will not return, though it may throw an exception. DNOTE: The server will only listen on IPv4 due to portability issues  in the Network module. For IPv6 support, use  m with custom socket. kA combination of l and . See  0 for a discussion of the first argument of this  function. =NOTE: This function always binds to IPv4 ports until Network 8 module is fixed to support IPv6 in a portable way. Use  m* with custom socket if you want different  behaviour. lGenerate a result from a  and a @? . This is - mainly used by CGI (and fast-cgi) wrappers. mRun j/ with a previously bound socket. Useful if you D want to run happstack as user on port 80. Use something like this:  J import System.Posix.User (setUserID, UserEntry(..), getUserEntryForName)   main = do ' let conf = nullConf { port = 80 }  socket <- bindPort conf $ -- do other stuff as root here 6 getUserEntryForName "www" >>= setUserID . userID 1 -- finally start handling incoming requests ; tid <- forkIO $ simpleHTTPWithSocket socket conf impl Note: It'7s important to use the same conf (or at least the same  port) for o and m.  see also: o, p nLike k with a socket. o-Bind port and return the socket for use with m. This C function always binds to IPv4 ports until Network module is fixed $ to support IPv6 in a portable way. pBIP address to bind to (must be an IP address and not a host name) port number to bind to  Takes your  , if it is mempty it returns } else it  converts the value to a QL and applies your filter to it.  %&'()*+,-./0124<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0WXYZ[\]^_`abcdefghijklmnopjklmnopiijklmnop q reads the Accept-Encoding header. Then, if possible . will compress the response body with methods gzip or deflate.  main =  simpleHTTP nullConf $ ) do str <- compressedResponseFilter I return $ toResponse ("This response compressed using: " ++ str) name of the encoding chosen r Ignore the Accept-Encoding header in the @?7 and attempt to compress the body of the response with gzip. calls t using  .  see also: q ,encoding to use for Content-Encoding header "fallback to identity for SendFile s Ignore the Accept-Encoding header in the @?8 and attempt compress the body of the response with zlib's  deflate method calls t using  .  see also: q ,encoding to use for Content-Encoding header "fallback to identity for SendFile t Ignore the Accept-Encoding header in the @?Q and attempt to compress the body of the response using the supplied compressor. 1We can not compress files being transfered using M. If  identity. is an allowed encoding, then just return the QL ! unmodified. Otherwise we return 406 Not Acceptable.  see also: r and  defaultFilter function to compress the body ,encoding to use for Content-Encoding header "fallback to identity for SendFile  1based on the rules describe in rfc2616 sec. 14.3   u(a parser for the Accept-Encoding header qrstuqtrsuqrstu&qqvwxyzDPerforms an XSL transformation with lists of ByteStrings instead of  a String. {Equivalent to z4 but does not hide the inherent IO of the low-level  ByteString operations. |:Uses the provided xsl file to transform the given string. A This function creates temporary files during its execution, but  guarantees their cleanup. }.Note that the xsl file must have .xsl suffix. ~Use xsltproc to transform XML. Use saxon to transform XML. Use cmd to transform XML against xslPath. This function only  acts if the content-type is  application/xml. XSLT preprocessor. Usually ~ or . Path to xslt stylesheet.  Affected s.  vwxyz{|}~ }|z{v~yxw vwxyz{|}~''GHC-only, Windows, Linux, FreeBSD, OS X provisional'Happstack team <happs@googlegroups.com> %&'()*+,-./0124<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./01238:;<GJUVWXYZ[\]^_`abcdefghijklmnop()*+,-./011234567899:;<=>?@ABCDEFGHIJKLMNOPPQRSTUVWXYZ[\]^_`abcddefghijklmnopqrstpuvwxyz{{|}~!"""####                 C                                    ! " # $ % & ' ( ) * + , - . / 0 123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{;|}~ppddemn      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKL)*MNNOOPQ)RSTUVWXYZ[\]^_`abcdefghijklmno p p q r s t u v w x yz{|}~!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!""""""""""v""""">""""""""""""""""""""#XX           XX          !"#$%&'()*+,-./01happstack-server-6.2.2Happstack.Server.XSLT(Happstack.Server.Internal.TimeoutManagerHappstack.Server.Internal.TypesHappstack.Server.SURI'Happstack.Server.Internal.TimeoutSocket Happstack.Server.Internal.Cookie%Happstack.Server.Internal.MessageWrap"Happstack.Server.Internal.LowLevelHappstack.Server.Client Happstack.Server.Internal.MonadsHappstack.Server.CookieHappstack.Server.ResponseHappstack.Server.RqDataHappstack.Server.MonadsHappstack.Server.AuthHappstack.Server.ErrorHappstack.Server.ProxyHappstack.Server.Validation)Happstack.Server.FileServe.BuildingBlocksHappstack.Server.RoutingHappstack.Server.SimpleHTTP%Happstack.Server.Internal.Compression"Happstack.Server.Internal.SocketTH Happstack.Server.Internal.Socket#Happstack.Server.Internal.LazyLinerHappstack.Server.SURI.ParseURI"Happstack.Server.HTTPClient.StreamHappstack.Server.HTTPClient.TCP Happstack.Server.HTTPClient.HTTPPaths_happstack_server'Happstack.Server.Internal.RFC822HeadersHappstack.Server.Internal.Clock#Happstack.Server.Internal.Multipart!Happstack.Server.Internal.Handler Happstack.Server.Internal.ListenHappstack.Server.TypesHappstack.Server.FileServeHappstack.Server.CompressionHappstack.ServerXSLTCmdHandleManager initializeregisterticklepauseresumecancel ContentTypectType ctSubtype ctParametersFromPathfromPathToSURItoSURISURIsuripathqueryschemeu_schemeu_patha_schemea_pathunEscapeescapeisAbsrenderparse sPutTickle sGetContentssendFileTickle iterTickle CookieLifeExpiredExpiresMaxAgeSessionCookie cookieVersion cookiePath cookieDomain cookieName cookieValuesecurehttpOnlycalcLifemkCookiemkCookieHeader parseCookies cookiesParser getCookies getCookie getCookies' getCookie'RqBodyBodyunBodyRequestrqMethodrqPathsrqUrirqQuery rqInputsQuery rqInputsBody rqCookies rqVersion rqHeadersrqBodyrqPeerResponseSendFile sfFilePathsfOffsetsfCountrsCode rsHeadersrsFlagsrsBody rsValidatorHostInput inputValue inputFilenameinputContentTypeRsFlags rsfLengthLengthNoContentLengthTransferEncodingChunked ContentLengthHeaders HeaderPairhNamehValueMethodCONNECTOPTIONSTRACEDELETEPUTPOSTHEADGETConfport validator logAccesstimeout HttpVersion isHTTP1_1 isHTTP1_0 continueHTTPnullConf nullRsFlagsnoContentLengthchunked contentLengthtakeRequestBodyreadInputsBodyrqURL setRsCode mkHeaders getHeader getHeaderBSgetHeaderUnsafe hasHeader hasHeaderBShasHeaderUnsafe setHeader setHeaderBSsetHeaderUnsafe addHeader addHeaderBSaddHeaderUnsaferesultresultBSredirectdefaultInputIter ReadString readString BodyPolicy inputWorkermaxDiskmaxRAM maxHeader queryInputdefaultBodyPolicy bodyInput formDecode decodeBodymultipartDecodepathElsrequest parseResponse putRequestlistenOn listenOnIPv4listenlisten' getResponseWebMonad finishWithUnWebTWebTunWebT FilterMonad setFilter composeFilter getFilterFilterT unFilterT FilterFun SetAppendAppendSet ServerMonadaskRqlocalRq ServerPartT unServerPartT ServerPartWebrunServerPartT withRequest anyRequestmapServerPartTmapServerPartT'extract unFilterFun filterFun ignoreFiltersescape'ununWebTmkWebTmapWebT localContextmulti debugFilteroutputTraceMessage mkFailMessagefailHtml escapeString addCookie addCookies expireCookie ToMessage toContentType toMessage toResponse toResponseBSflattenifModifiedSincesetResponseCoderespok noContentinternalServerError badGateway badRequest unauthorized forbiddennotFoundrequestEntityTooLargeseeOtherfoundmovedPermanently tempRedirectFromDatafromData HasRqDataaskRqEnv localRqEnv rqDataErrorRqDataRqEnvErrorsunErrors mapRqDatareadRqcheckRqcheckRqM lookInput lookInputslookBSlookBSslooklookslookText lookTexts lookCookielookCookieValuereadCookieValuelookRead lookReadslookFile lookPairs lookPairsBS getDataFn withDataFngetDatawithDatabody queryString Happstack getHeaderM addHeaderM setHeaderMrequirerequireM basicAuthspUnwrapErrorTsimpleErrorHandlererrorHandlerSP proxyServe proxyServe' rproxyServe unproxify unrproxify setValidatorsetValidatorSP validateConf runValidatorwdgHTMLValidator noopValidatorlazyProcValidatorBrowsingDisableBrowsingEnableBrowsing EntryKind UnknownKind DirectoryFileMimeMapguessContentTypeguessContentTypeM asContentTypedefaultIxFiles fileNotFound blockDotFilesisDotsendFileResponselazyByteStringResponsestrictByteStringResponsefilePathSendFile filePathLazyfilePathStrictserveFileUsing serveFile fileServe' isSafePath fileServe fileServeLazyfileServeStrictdoIndex doIndexLazy doIndexStrictdoIndex'tryIndex browseIndexrenderDirectoryContentsrenderDirectoryContentsTableserveDirectory mimeTypes FromReqURI fromReqURI MatchMethod matchMethodguardRqmethodM methodOnlymethodSPmethodnullDirdirdirshostwithHosturiRestanyPath trailingSlash parseConfig simpleHTTP simpleHTTP' simpleHTTP''simpleHTTPWithSocketsimpleHTTPWithSocket'bindPortbindIPv4compressedResponseFilter gzipFilter deflateFiltercompressWithFilter encodingsXSLPath XSLTCommand procLBSIO procFPSIOxsltFPS xsltFPSIO xsltStringxsltFilexsltprocsaxonxsltdoXslt supportsIPv6 acceptLiteLazynewLinerHandle headerLinesgetBytesStrictgetBytesgetResttoStrictbytestring-0.9.2.0Data.ByteString.LazytoChunks parseURIRefpabsuri pauthority pauthinner pauthportpurirefpquery pfragment unsafeTail unsafeHead unsafeIndexDebug debugStreamDbgStreamreadLine readBlock writeBlockcloseResult ConnError ErrorMisc ErrorParse ErrorClosed ErrorResetbindEhandleSocketErrormyrecvConn ConnClosedMkConnconnSockconnAddrconnBffrconnHost ConnectionConnRefgetRefopenTCP openTCPPort isConnectedTo Behaviour DieHorribly ExpectEntityDoneRetryContinuebaseGHC.ShowShowrspCode rspReason rspHeadersrspBody RequestData ResponseData ResponseCoderqURIGHC.Num* RequestMethod HasHeaders getHeaders setHeaders HeaderName HdrCustomHdrContentTransferEncodingHdrLastModified HdrExpiresHdrETagHdrContentTypeHdrContentRange HdrContentMD5HdrContentLocationHdrContentLengthHdrContentLanguageHdrContentEncodingHdrContentBaseHdrAllowHdrWWWAuthenticate HdrWarningHdrVary HdrSetCookie HdrServer HdrRetryAfter HdrPublicHdrProxyAuthenticate HdrLocationHdrAge HdrUserAgent HdrRefererHdrRangeHdrProxyAuthorizationHdrMaxForwardsHdrIfUnmodifiedSince HdrIfRangeHdrIfNoneMatch HdrIfMatchHdrIfModifiedSinceHdrHostHdrFrom HdrExpect HdrCookieHdrAuthorizationHdrAcceptLanguageHdrAcceptEncodingHdrAcceptCharset HdrAcceptHdrVia HdrUpgradeHdrTransferEncoding HdrPragmaHdrDate HdrConnectionHdrCacheControlHeaderdebug httpLogFiletrimsplitcrlfsp headerMap insertHeaderinsertHeaderIfMissing replaceHeader insertHeadersretrieveHeaders findHeader lookupHeader httpVersion rqMethodMap parseHeader parseHeadersparseRequestHeadparseResponseHead matchResponse simpleHTTP_getAuthsendHTTPsendHTTPPipelined receiveHTTP respondHTTPlinearTransferhopefulTransferchunkedTransferchunkedTransferCuglyDeathTransferreadTillEmpty1readTillEmpty2 urlDecode urlEncode urlEncodeVarscatchIOversionbindirlibdirdatadir libexecdir getBinDir getLibDir getDataDir getLibexecDirgetDataFileNameStateCanceledPausedInactiveActive ignoreAllContentDispositionContentTransferEncodingshowContentTypepHeaderspHeaderextraFieldLineshowParameters p_parameter pContentTypeparseContentTypeGHC.BasefailgetContentTypepContentTransferEncodingparseContentTransferEncodinggetContentTransferEncodingpContentDispositionparseContentDispositiongetContentDispositionparseMlookupMws1lexemecrLf lineString literalStringbuggyLiteralStringheaderNameChar especials tokencharp_token text_charsp_text quoted_pair DateCachecachedPOSIXTimecachedHttpDateformatHttpDatemkTimeclockupdatergetApproximateTimegetApproximatePOSIXTimegetApproximateUTCTimefctllow updateHeadersheaders logMAccessghc-prim GHC.TypesTrue Data.MaybeNothinggetHeaderUnsafe' checkHeaderBScheckHeaderUnsafe locationCcloseC connectionC keepaliveC FileSaver InputIter HeaderResult BodyResultFailed InputWorkerWork HeaderWorkBodyWorkBodyPartspanSGHC.Listspan takeWhileScrlfcrlf blankLine dropWhileS hPutLimit hPutLimit'bodyPartToInputbodyPartsToInputs multipartBody simpleInputdefaultInputTypeparseMultipartBody dropPreambledropLine isBoundarystartsWithDashes splitParts splitPart splitBlank splitBoundarysplitAtEmptyLine splitAtCRLFdefaultFileSaverGHC.ReadReadrequiredrloopcleanupTempFiles consumeChunksconsumeChunksImplcrlfLC lazylines requestLine responseLine staticHeadersputAugmentedResultaugmentHeaderspversionhttp09http10http11connectionCLower keepAliveCcrlfCfsepC contentTypeCcontentLengthCcontentlengthCdateC dateCLowerserverChappsC textHtmlCtransferEncodingCchunkedCresponseMessagelog'idMonadMaybe Control.MonadmzeroJust Data.EitherEither Data.MonoidEndoDualMonoidLeftRight mtl-2.0.1.0Control.Monad.Reader.Class MonadReadertransformers-0.2.2.0Control.Monad.Trans.ReaderReaderTIOControl.Monad.Trans.ErrorErrorTControl.Monad.Error.Class throwError catchErrormsumData.ByteString.Lazy.Char8packmodifyResponseunRqData ReaderError unReaderErrorapEithermapReaderErrorT readerErrorrunReaderError runRqDatafmap Text.ReadreadStringlookups fromMaybeBody text-0.11.1.5Data.Text.Lazy.InternalTextright bytestringcontainers-0.4.1.0Data.MapMapioErrors errorwrapperGHC.IOFilePathgetExtfilepath-1.2.0.1System.FilePath.Posix takeExtensionisParent getMetaDataIntFloathappstack-util-6.0.0Happstack.Util.CommonreadMGHC.Real/hoSystem.Console.GetOptOptDescrrunWebT notFoundHtml zlib-0.5.3.1Codec.Compression.GZipcompressCodec.Compression.Zlib bestEncodingallEncodingHandlers allEncodingshandlersSaxonXSLTProc!dataType_sybwc_XSLTCmd_1627803384 constr_sybwc_XSLTProc_1627803386constr_sybwc_Saxon_1627803385logMXxsltCmd xsltproc'saxon' xsltFileEx withTempFilereadFileStricttempDirtryAny