Skip to content

Add tamper-proof handler monad for strict servant API handling #19

Description

@imalsogreg

In servant-server, it is impossible for a user-defined handler to inspect the request and to mess with the response. Since servant-snap uses any MonadSnap m => m a as the handler monad, we lose this guarantee, making it possible to branch on runtime information in the request and to call functions like writeText that impurely modify the response.

The goal of running in a restrictive monad like servant-server's Handler' is to ensure that all HTTP logic is determined by the type of the API. We should provide that functionality in servant-snap` for users that want this level of safety in their API handlers.

It's not clear how this would interact with Snaplets ability to provide use values (db connections, local state, etc.)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions