h&kFd      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  Safe-Inferred0scottyHandlers are tried sequentiallyscottyif present, this  is tried firstscottythese are tried in order Safe-Inferred%&6? 1scotty'Thrown e.g. when a request is too large3scottySpecializes a  to the  monad4scottyE.g. when a parameter is not found in a query string (400 Bad Request) or when parsing a JSON body fails (422 Unprocessable Entity)6scottyInternal exception mechanism used to modify the request processing flow.The exception constructor is not exposed to the user and all exceptions of this type are caught and processed within the  runAction function.7scottyRedirect8scotty3Stop processing this route and skip to the next one9scottyStop processing the requestCscottyThe key part of having two MVars is that we can "clone" the BodyInfo to create a copy where the index is reset to 0, but the chunk cache is the same. Passing a cloned BodyInfo into each matched route allows them each to start from the first chunk if they call bodyReader.Introduced in (#308)Escotty!index into the stream read so farGscotty can be called to get more chunksJscotty/whether we've reached the end of the stream yetTscotty#0 = silent, 1(def) = startup bannerUscottyWarp  Note: to work around an issue in warp, the default FD cache duration is set to 0 so changes to static files are always picked up. This likely has performance implications, so you may want to modify this for production servers using setFdCacheDuration.cscotty3The default response has code 200 OK and empty bodydscotty&catches either ActionError (thrown by next) or 40 (thrown if e.g. a query parameter is not found)"! #$%.-,+*)('&/0123456987:<;=BA?@>CGFEDHKJILMNOQPRUTSVWXYZ[\]^_`abcdRUTSVOQPWNMLHKJICGFED=BA?@>XYZ[\:<;6987]453120/%.-,+*)('&^_#$"! `abcd Safe-Inferred scottyreturn request body or throw a 2 if request body too bigscottybody chunk readerscotty max body size Safe-Inferred")>+scottyMinimum implemention: scottyTake a  value and parse it as a, or fail with a message.scotty4Default implementation parses comma-delimited lists. 7parseParamList t = mapM parseParam (T.split (== ',') t)scottyEvaluate a route, catch all exceptions (user-defined ones, internal and all remaining, in this order) and construct the  indicates route failed (due to Next) and pattern matching should try the next available route. ! indicates a successful response.scottyCatches 4+ and produces an appropriate HTTP response.scottyException handler in charge of 6 . Rethrowing Next here is caught by ]. All other cases of 6! are converted to HTTP responses.scotty9Uncaught exceptions turn into HTTP 500 Server Error codesscottyThrow a "500 Server Error" 4, which can be caught with .1Uncaught exceptions turn into HTTP 500 responses.scottyThrow a 4 exception that has an associated HTTP error code and can be caught with .Uncaught exceptions turn into HTTP responses corresponding to the given status.scottyThrow an exception which can be caught within the scope of the current Action with  or .If the exception is not caught locally, another option is to implement a global  (with defaultHandler) that defines its interpretation and a translation to HTTP error codes.1Uncaught exceptions turn into HTTP 500 responses.scottyAbort execution of this action and continue pattern matching routes. Like an exception, any code after  is not executed.NB : Internally, this is implemented with an exception that can only be caught by the library, but not by the user.As an example, these two routes overlap. The only way the second one will ever run is if the first one calls . get "/foo/:bar" $ do w :: Text <- captureParam "bar" unless (w == "special") next text "You made a request to /foo/special" get "/foo/:baz" $ do w <- captureParam "baz" text $ "You made a request to: " <> wscottyCatch an exception e.g. a 4 or a user-defined exception. -raise JustKidding `rescue` (\msg -> text msg)scotty#Catch any synchronous IO exceptionsscottyRedirect to given URL. Like throwing an uncatchable exception. Any code after the call to redirect will not be run.  redirect "http://www.google.com"OR redirect "/foo/bar"scottyFinish the execution of the current action. Like throwing an uncatchable exception. Any code after the call to finish will not be run. Since: 0.10.3scottyGet the  object.scottyGet list of uploaded files.scotty6Get a request header. Header name is case-insensitive.scotty?Get all the request headers. Header names are case-insensitive.scottyGet the request body.scotty'Get an IO action that reads body chunksThis is incompatible with  since  consumes all chunks.scotty6Parse the request body as a JSON object and return it.If the JSON object is malformed, this sets the status to 400 Bad Request, and throws an exception.If the JSON fails to parse, this sets the status to 422 Unprocessable Entity.These status codes are as per  4https://www.restapitutorial.com/httpstatuscodes.html.scottyGet a parameter. First looks in captures, then form data, then query parameters.+Raises an exception which can be caught by  if parameter is not found.If parameter is found, but % fails to parse to the correct type,  is called. This means captures are somewhat typed, in that a route won't match if a correctly typed capture cannot be parsed.scottyGet a capture parameter.+Raises an exception which can be caught by  if parameter is not found. If the exception is not caught, scotty will return a HTTP error code 500 ("Internal Server Error") to the client.If the parameter is found, but % fails to parse to the correct type,  is called.scottyGet a form parameter.+Raises an exception which can be caught by  if parameter is not found. If the exception is not caught, scotty will return a HTTP error code 400 ("Bad Request") to the client.This function raises a code 400 also if the parameter is found, but $ fails to parse to the correct type.scottyGet a query parameter.+Raises an exception which can be caught by  if parameter is not found. If the exception is not caught, scotty will return a HTTP error code 400 ("Bad Request") to the client.This function raises a code 400 also if the parameter is found, but $ fails to parse to the correct type.scottyGet all parameters from capture, form and query (in that order).scottyGet capture parametersscottyGet form parametersscottyGet query parametersscottyUseful for creating - instances for things that already implement . Ex: 3instance Parsable Int where parseParam = readEitherscottySet the HTTP response status.scotty?Add to the response headers. Header names are case-insensitive.scottySet one of the response headers. Will override any previously set value for that header. Header names are case-insensitive.scotty*Set the body of the response to the given  value. Also sets "Content-Type" header to "text/plain; charset=utf-8" if it has not already been set.scotty*Set the body of the response to the given  value. Also sets "Content-Type" header to "text/html; charset=utf-8" if it has not already been set.scottySend a file as the response. Doesn't set the "Content-Type" header, so you probably want to do that on your own with . Setting a status code will have no effect because Warp will overwrite that to 200 (see  ).scottySet the body of the response to the JSON encoding of the given value. Also sets "Content-Type" header to "application/json; charset=utf-8" if it has not already been set.scottySet the body of the response to a Source. Doesn't set the "Content-Type" header, so you probably want to do that on your own with .scotty*Set the body of the response to the given  value. Doesn't set the "Content-Type" header, so you probably want to do that on your own with .scottyNest a whole WAI application inside a Scotty handler. See Web.Scotty for further documentationscottyChecks if parameter is present and is null-valued, not a literal ()3. If the URI requested is: '/foo?bar=()&baz' then baz will parse as (), where bar will not.scottyOverrides default  to parse String.scottythis handler (if present) is in charge of user-defined exceptionsscottyRoute action to be evaluatedscotty Error textscotty/HTTP status to return if parameter is not foundscottyparameter name(0  Safe-Inferred"%&,scottyMake a new BodyInfo with readProgress at 0 and an empty BodyChunkBuffer.scottyMake a copy of a BodyInfo, sharing the previous BodyChunkBuffer but with the readProgress MVar reset to 0.scottyGet the form params and files from the request. Requires reading the whole body.scottyRetrieve the entire body, using the cached chunks in the BodyInfo and reading any other chunks if they still exist. Mimic the previous behavior by throwing BodyPartiallyStreamed if the user has already started reading the body by chunks.scottyRetrieve a chunk from the body at the index stored in the readProgress MVar. Serve the chunk from the cached array if it's already present; otherwise read another chunk from WAI and advance the index.  Safe-Inferred"5scottyget =  scottypost =  scottyput =  scotty delete =  scottypatch =  scotty options =  scotty5Add a route that matches regardless of the HTTP verb.scottySpecify an action to take if nothing else is found. Note: this _always_ matches, so should generally be the last route specified.scottyDefine a route with a , 0 value representing the path spec, and a body (Action) which modifies the response. %addroute GET "/" $ text "beam me up!"The path spec can include values starting with a colon, which are interpreted as captures7. These are named wildcards that can be looked up with . addroute GET "/foo/:bar" $ do v <- captureParam "bar" text v(curl http://localhost:3000/foo/something somethingNB: the O and the exception handler of the newly-created route will be copied from the previously-created routes.scotty,Parse the request and construct the initial % with a default 200 OK responsescottyMatch requests using a regular expression. Named captures are not yet supported. get (regex "^/f(.*)r$") $ do path <- param "0" cap <- param "1" text $ mconcat ["Path: ", path, "\nCapture: ", cap]"curl http://localhost:3000/foo/barPath: /foo/barCapture: oo/bascottyStandard Sinatra-style route. Named captures are prepended with colons. This is the default route type generated by OverloadedString routes. i.e. get (capture "/foo/:bar") $ ...and <{-# LANGUAGE OverloadedStrings #-} ... get "/foo/:bar" $ ...are equivalent.scottyBuild a route based on a function which can match using the entire  object. ' indicates the route does not match. A  value indicates a successful match, optionally returning a list of key-value pairs accessible by . get (function $ \req -> Just [("version", T.pack $ show $ httpVersion req)]) $ do v <- param "version" text vcurl http://localhost:3000/HTTP/1.1scottyBuild a route that requires the requested path match exactly, without captures.  Safe-Inferred";scottyRun a scotty application using the warp server. NB: scotty p === scottyT p idscottyRun a scotty application using the warp server, passing extra options. NB: scottyOpts opts === scottyOptsT opts idscottyRun a scotty application using the warp server, passing extra options, and listening on the provided socket. NB: scottySocket opts sock === scottySocketT opts sock idscotty%Turn a scotty application into a WAI L, which can be run with any WAI handler. NB: scottyApp === scottyAppT idscotty+Global handler for user-defined exceptions.scottyException handler in charge of 1scottyUse given middleware. Middleware is nested such that the first declared is the outermost middleware (it has first dibs on the request and last action on the response). Every middleware is run on each request.scottySet global size limit for the request body. Requests with body size exceeding the limit will not be processed and an HTTP response 413 will be returned to the client. Size limit needs to be greater than 0, otherwise the application will terminate on start.scotty Run monad m into , called at each action.scotty Run monad m into , called at each action.scotty Run monad m into , called at each action.scottyRequest size limit/0345:=NRSTUVXRSTUV450/N3:=X?(c) 2014, 2015 Mrti Mas, (c) 2023 Marco Zocca BSD-3-Clause experimentalGHC Safe-Inferred"?scotty3Set a cookie, with full access to its options (see )scotty and  combined.scottyLookup one cookie namescottyReturns all cookiesscottyBrowsers don't directly delete a cookie, but setting its expiry to a past date (e.g. the UNIX epoch) ensures that the cookie will be invalidated (whether and when it will be actually deleted by the browser seems to be browser-dependent).scottyConstruct a simple cookie (an UTF-8 string pair with default cookie options)scottynamescottyvaluescottynamescottynamescottynamescottyvalue   Safe-Inferred"c5scotty/Run a scotty application using the warp server.scottyRun a scotty application using the warp server, passing extra options.scottyRun a scotty application using the warp server, passing extra options, and listening on the provided socket. This allows the user to provide, for example, a Unix named socket, which can be used when reverse HTTP proxying into your application.scotty%Turn a scotty application into a WAI ), which can be run with any WAI handler.scotty+Global handler for user-defined exceptions.scottyUse given middleware. Middleware is nested such that the first declared is the outermost middleware (it has first dibs on the request and last action on the response). Every middleware is run on each request.scottyNest a whole WAI application inside a Scotty handler. Note: You will want to ensure that this route fully handles the response, as there is no easy delegation as per normal Scotty actions. Also, you will have to carefully ensure that you are expecting the correct routes, this could require stripping the current prefix, or adding the prefix to your application's handlers if it depends on them. One potential use-case for this is hosting a web-socket handler under a specific route.scottySet global size limit for the request body. Requests with body size exceeding the limit will not be processed and an HTTP response 413 will be returned to the client. Size limit needs to be greater than 0, otherwise the application will terminate on start. scottyThrow a "500 Server Error" 4, which can be caught with .1Uncaught exceptions turn into HTTP 500 responses.scottyThrow a 4 exception that has an associated HTTP error code and can be caught with .Uncaught exceptions turn into HTTP responses corresponding to the given status.scottyThrow an exception which can be caught within the scope of the current Action with  or catch.If the exception is not caught locally, another option is to implement a global  (with ) that defines its interpretation and a translation to HTTP error codes.1Uncaught exceptions turn into HTTP 500 responses.scottyAbort execution of this action and continue pattern matching routes. Like an exception, any code after  is not executed.NB : Internally, this is implemented with an exception that can only be caught by the library, but not by the user.As an example, these two routes overlap. The only way the second one will ever run is if the first one calls . get "/foo/:bar" $ do w :: Text <- captureParam "bar" unless (w == "special") next text "You made a request to /foo/special" get "/foo/:baz" $ do w <- captureParam "baz" text $ "You made a request to: " <> wscottyAbort execution of this action. Like an exception, any code after  is not executed.As an example only requests to  /foo/special8 will include in the response content the text message. get "/foo/:bar" $ do w :: Text <- captureParam "bar" unless (w == "special") finish text "You made a request to /foo/special" Since: 0.10.3scottyCatch an exception e.g. a 4 or a user-defined exception. -raise JustKidding `rescue` (\msg -> text msg)scottyLike liftIO, but catch any IO exceptions and turn them into Scotty exceptions.scottyRedirect to given URL. Like throwing an uncatchable exception. Any code after the call to redirect will not be run.  redirect "http://www.google.com"OR redirect "/foo/bar"scottyGet the  object.scottyGet list of uploaded files.scotty6Get a request header. Header name is case-insensitive.scotty?Get all the request headers. Header names are case-insensitive.scottyGet the request body.scotty'Get an IO action that reads body chunksThis is incompatible with  since  consumes all chunks.scottyParse the request body as a JSON object and return it. Raises an exception if parse is unsuccessful.scottyGet a parameter. First looks in captures, then form data, then query parameters.+Raises an exception which can be caught by  if parameter is not found.If parameter is found, but  parseParam% fails to parse to the correct type,  is called. This means captures are somewhat typed, in that a route won't match if a correctly typed capture cannot be parsed.scottyGet a capture parameter.+Raises an exception which can be caught by  if parameter is not found. If the exception is not caught, scotty will return a HTTP error code 500 ("Internal Server Error") to the client.If the parameter is found, but  parseParam% fails to parse to the correct type,  is called.scottyGet a form parameter.+Raises an exception which can be caught by  if parameter is not found. If the exception is not caught, scotty will return a HTTP error code 400 ("Bad Request") to the client.This function raises a code 400 also if the parameter is found, but  parseParam$ fails to parse to the correct type.scottyGet a query parameter.+Raises an exception which can be caught by  if parameter is not found. If the exception is not caught, scotty will return a HTTP error code 400 ("Bad Request") to the client.This function raises a code 400 also if the parameter is found, but  parseParam$ fails to parse to the correct type.scottyGet all parameters from capture, form and query (in that order).scottyGet capture parametersscottyGet form parametersscottyGet query parametersscotty-Set the HTTP response status. Default is 200.scotty?Add to the response headers. Header names are case-insensitive.scottySet one of the response headers. Will override any previously set value for that header. Header names are case-insensitive.scotty*Set the body of the response to the given  value. Also sets "Content-Type" header to "text/plain; charset=utf-8" if it has not already been set.scotty*Set the body of the response to the given  value. Also sets "Content-Type" header to "text/html; charset=utf-8" if it has not already been set.scottySend a file as the response. Doesn't set the "Content-Type" header, so you probably want to do that on your own with .scottySet the body of the response to the JSON encoding of the given value. Also sets "Content-Type" header to "application/json; charset=utf-8" if it has not already been set.scottySet the body of the response to a StreamingBody. Doesn't set the "Content-Type" header, so you probably want to do that on your own with .scotty*Set the body of the response to the given    value. Doesn't set the "Content-Type" header, so you probably want to do that on your own with .scottyget =  GETscottypost =  POSTscottyput =  PUTscotty delete =  DELETEscottypatch =  PATCHscotty options =  OPTIONSscotty5Add a route that matches regardless of the HTTP verb.scottySpecify an action to take if nothing else is found. Note: this _always_ matches, so should generally be the last route specified.scottyDefine a route with a , 0 value representing the path spec, and a body (Action) which modifies the response. %addroute GET "/" $ text "beam me up!"The path spec can include values starting with a colon, which are interpreted as captures7. These are named wildcards that can be looked up with . =addroute GET "/foo/:bar" $ do v <- param "bar" text v(curl http://localhost:3000/foo/something somethingscottyMatch requests using a regular expression. Named captures are not yet supported. get (regex "^/f(.*)r$") $ do path <- param "0" cap <- param "1" text $ mconcat ["Path: ", path, "\nCapture: ", cap]"curl http://localhost:3000/foo/barPath: /foo/barCapture: oo/bascottyStandard Sinatra-style route. Named captures are prepended with colons. This is the default route type generated by OverloadedString routes. i.e. get (capture "/foo/:bar") $ ...and <{-# LANGUAGE OverloadedStrings #-} ... get "/foo/:bar" $ ...are equivalent.scottyBuild a route based on a function which can match using the entire  object. ' indicates the route does not match. A  value indicates a successful match, optionally returning a list of key-value pairs accessible by . get (function $ \req -> Just [("version", pack $ show $ httpVersion req)]) $ do v <- param "version" text vcurl http://localhost:3000/HTTP/1.1scottyBuild a route that requires the requested path match exactly, without captures./045=NRSTUVXRSTUV450/N=X !" !"#$%&''()*+,-./01233456789:;<=>?@ABCCDEFGHHIJJKLMNOOPQRSSTUVWXYYZ[[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                    V"scotty-0.20-3KPLiKBFOMAHJWnIsYEmlqWeb.Scotty.CookieWeb.Scotty.TransWeb.Scotty.Internal.Types Web.ScottyWeb.Scotty.ExceptionsWeb.Scotty.UtilWeb.Scotty.Action!Network.Wai.Handler.Warp.Internal sendResponseWeb.Scotty.BodyWeb.Scotty.RouteBL ByteString#cookie-0.4.6-5vy9yyVLJTw1SJvSixS3wD Web.CookiedefaultSetCookie sameSiteNonesameSiteStrict sameSiteLax CookiesTextsetCookieSameSitesetCookieSecuresetCookieHttpOnlysetCookieDomainsetCookieMaxAgesetCookieExpires setCookiePathsetCookieValue setCookieName SetCookieSameSiteOptionexceptions-0.10.4Control.Monad.CatchHandler RoutePatternCaptureLiteralFunctionActionTrunAMScottyResponseSRsrStatus srHeaders srContentContentContentBuilder ContentFile ContentStreamContentResponseBodyPartiallyStreamed ActionEnvEnvenvReqenvCaptureParams envFormParamsenvQueryParamsenvBody envBodyChunkenvFiles envResponseFileParamScottyExceptionRequestException ErrorHandler StatusError ActionError AERedirectAENextAEFinishScottyTrunS ScottyState middlewaresrouteshandler routeOptionsBodyInfobodyInfoReadProgressbodyInfoChunkBufferbodyInfoDirectChunkReadBodyChunkBufferhasFinishedReadingChunkschunksReadSoFar Application Middleware Kilobytes RouteOptionsmaxRequestBodySizeOptionsverbosesettingsdefaultOptionsdefaultRouteOptionsdefaultScottyState addMiddlewareaddRoute setHandlerupdateMaxRequestBodySizetryNext getResponsemodifyResponse setContent setHeaderWith setStatusdefaultScottyResponse tryAnyStatus$fDefaultOptions$fDefaultRouteOptions$fExceptionActionError$fExceptionStatusError$fExceptionScottyException $fExceptionBodyPartiallyStreamed$fDefaultScottyResponse$fMonoidActionT$fSemigroupActionT$fMonadPlusActionT$fAlternativeActionT$fDefaultScottyState$fMonoidScottyT$fSemigroupScottyT$fIsStringRoutePattern$fFunctorScottyT$fApplicativeScottyT$fMonadScottyT$fFunctorActionT$fApplicativeActionT$fMonadActionT$fMonadIOActionT$fMonadReaderActionEnvActionT$fMonadTransActionT$fMonadThrowActionT$fMonadCatchActionT$fMonadBasebActionT$fMonadBaseControlbActionT$fMonadTransControlActionT$fMonadUnliftIOActionT$fShowBodyPartiallyStreamed$fShowScottyException$fShowStatusError$fShowActionErrorParsable parseParamparseParamListraise raiseStatusthrownextrescueliftAndCatchIOredirectfinishrequestfilesheaderheadersbody bodyReaderjsonDataparam captureParam formParam queryParamparams captureParams formParams queryParams readEitherstatus addHeader setHeadertexthtmlfilejsonstreamrawnestedgetpostputdeletepatchoptionsmatchAnynotFoundaddrouteregexcapturefunctionliteralscottyT scottyOptsT scottySocketT scottyAppTdefaultHandler middlewaresetMaxRequestBodySize setCookiesetSimpleCookie getCookie getCookies deleteCookiemakeSimpleCookieActionMScottyMscotty scottyOpts scottySocket scottyAppcatchesOptionally(unliftio-0.2.25.0-Cin3NvA5fXkCe3USvjdfCUUnliftIO.ExceptioncatchestryAnytrycatchAnycatch"warp-3.3.29-H2njpOqk6Qj81arEP3CcPU!Network.Wai.Handler.Warp.SettingsSettingsreadRequestBodylazyTextToStrictByteStringstrictByteStringToLazyText mkResponsereplaceaddaddIfNotPresentsocketDescription text-1.2.5.0Data.Text.Internal.LazyText runAction wai-3.2.3-HcRsDPD1jvkAbx3SrvpHv6Network.Wai.InternalResponsebase GHC.MaybeNothingJuststatusErrorHandleractionErrorHandlersomeExceptionHandlerRequestGHC.ReadReadbytestring-0.11.3.1Data.ByteString.Lazy.Internal $fParsable()$fParsableChar paramWith rawResponse newBodyInfo cloneBodyInfogetFormParamsAndFilesAction getBodyActiongetBodyChunkAction(http-types-0.12.3-JlXMXDo7mr8Ke1ukSqfJrBNetwork.HTTP.Types.MethodGETPOSTPUTDELETEPATCHOPTIONS StdMethodmkEnvscottyExceptionHandlerghc-prim GHC.TypesIO Network.Wai