Hoogle Search
Within LTS Haskell 24.66 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
forbidden :: FilterMonad Response m => a -> m ahappstack-server Happstack.Server.Response Respond with 403 Forbidden.
main = simpleHTTP nullConf $ forbidden "Sorry, it is forbidden."
rsValidator :: Response -> Maybe (Response -> IO Response)happstack-server Happstack.Server.Types No documentation available.
rsValidator :: Response -> Maybe (Response -> IO Response)happstack-server Happstack.Server.Types No documentation available.
validator :: Conf -> Maybe (Response -> IO Response)happstack-server Happstack.Server.Types a function to validate the output on-the-fly
module Happstack.Server.
Validation Support for validating server output on-the-fly. Validators can be configured on a per content-type basis.
-
happstack-server Happstack.Server.Validation Validate the Response using an external application. If the external application returns 0, the original response is returned unmodified. If the external application returns non-zero, a Response containing the error messages and original response body is returned instead. This function also takes a predicate filter which is applied to the 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 blocking. However, you probably need that for Happstack anyway. See also: wdgHTMLValidator.
noopValidator :: Response -> IO Responsehappstack-server Happstack.Server.Validation A validator which always succeeds. Useful for selectively disabling validation. For example, if you are sending down HTML fragments to an AJAX application and the default validator only understands complete documents.
runValidator :: (Response -> IO Response) -> Response -> IO Responsehappstack-server Happstack.Server.Validation Actually perform the validation on a Response. Run the validator specified in the Response. If none is provide use the supplied default instead. Note: This function will run validation unconditionally. You probably want setValidator or validateConf.
setValidator :: (Response -> IO Response) -> Response -> Responsehappstack-server Happstack.Server.Validation Set the validator which should be used for this particular Response when validation is enabled. Calling this function does not enable validation. That can only be done by enabling the validation in the Conf that is passed to simpleHTTP. You do not need to call this function if the validator set in Conf does what you want already. Example: (use noopValidator instead of the default supplied by validateConf)
simpleHTTP validateConf $ ok . setValidator noopValidator =<< htmlPage
See also: validateConf, wdgHTMLValidator, noopValidator, lazyProcValidator.setValidatorSP :: (Monad m, ToMessage r) => (Response -> IO Response) -> m r -> m Responsehappstack-server Happstack.Server.Validation ServerPart version of setValidator. Example: (Set validator to noopValidator)
simpleHTTP validateConf $ setValidatorSP noopValidator (dir "ajax" ... )