-- | Read the request from client.
receiveRequest :: Socket -> Controller ()
receiveRequest sock = do
        req <- liftIO $ receiveHTTP sock
        case req of
         Left e -> throwTurbinado $ BadRequest $ "In receiveRequest : " ++ show e
         Right r  -> do e <- get
                        put $ e {getRequest = Just r}

-- | Get the 'Response' from the 'Environment' and send
-- it back to the client.
receiveRequest :: Socket -> Controller ()
receiveRequest sock = do
        req <- liftIO $ receiveHTTP sock
        case req of
         Left e -> throwTurbinado $ BadRequest $ "In receiveRequest : " ++ show e
         Right r  -> do e <- get
                        put $ e {getRequest = Just r}

-- | Get the 'Response' from the 'Environment' and send
-- it back to the client.
receiveRequest sock = do
        req <- liftIO $ receiveHTTP sock
        case req of
         Left e -> throwTurbinado $ BadRequest $ "In receiveRequest : " ++ show e
         Right r  -> do e <- get
                        put $ e {getRequest = Just r}

-- | Get the 'Response' from the 'Environment' and send
-- it back to the client.