diff options
Diffstat (limited to 'Network/Wai')
-rw-r--r-- | Network/Wai/Middleware/Braid.hs | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/Network/Wai/Middleware/Braid.hs b/Network/Wai/Middleware/Braid.hs index f9832ac..5dbc7f4 100644 --- a/Network/Wai/Middleware/Braid.hs +++ b/Network/Wai/Middleware/Braid.hs @@ -65,19 +65,20 @@ import Network.Wai.Middleware.AddHeaders (addHeaders) type Topic = [Text] -data Update = -- | Updates are streamed from the server to subcribing client. - -- On a PUT request, the headers and request body are put into an Update and streamed to subscribing clients. - Update - { -- | The updateTopic is formed, from the request path - updateTopic :: [Text], - -- | The updateClient is an id generated by the client to prevent echo updates - -- https://github.com/braid-work/braid-spec/issues/72 - updateClient :: Maybe B.ByteString, - -- | The updateHeader are taken straight from the request headers - updateHeaders :: RequestHeaders, - -- | The updatePatches correspond to the request body - updatePatches :: L.ByteString - } +data Update + = -- | Updates are streamed from the server to subcribing client. + -- On a PUT request, the headers and request body are put into an Update and streamed to subscribing clients. + Update + { -- | The updateTopic is formed, from the request path + updateTopic :: [Text], + -- | The updateClient is an id generated by the client to prevent echo updates + -- https://github.com/braid-work/braid-spec/issues/72 + updateClient :: Maybe B.ByteString, + -- | The updateHeader are taken straight from the request headers + updateHeaders :: RequestHeaders, + -- | The updatePatches correspond to the request body + updatePatches :: L.ByteString + } isGetRequest, isPutRequest, isPatchRequest :: Wai.Request -> Bool isGetRequest req = Wai.requestMethod req == methodGet |