Add sendResponseNoContent.

This commit is contained in:
Steven Leiva 2018-11-30 14:22:40 -06:00
parent 6eb91bdb77
commit 2a9bef34c0
3 changed files with 12 additions and 1 deletions

View File

@ -1,5 +1,9 @@
# ChangeLog for yesod-core
## 1.6.9
* Add `sendResponseNoContent` [#1565](https://github.com/yesodweb/yesod/pull/1565)
## 1.6.8.1
* Add missing test file to tarball [#1563](https://github.com/yesodweb/yesod/issues/1563)

View File

@ -99,6 +99,7 @@ module Yesod.Core.Handler
-- ** Type specific response with custom status
, sendStatusJSON
, sendResponseCreated
, sendResponseNoContent
, sendWaiResponse
, sendWaiApplication
, sendRawResponse
@ -648,6 +649,12 @@ sendResponseCreated url = do
r <- getUrlRender
handlerError $ HCCreated $ r url
-- | Bypass remaining handler code and output no content with a 204 status code.
--
-- @since 1.6.9
sendResponseNoContent :: MonadHandler m => m a
sendResponseNoContent = sendWaiResponse $ W.responseBuilder H.status204 [] mempty
-- | Send a 'W.Response'. Please note: this function is rarely
-- necessary, and will /disregard/ any changes to response headers and session
-- that you have already specified. This function short-circuits. It should be

View File

@ -1,5 +1,5 @@
name: yesod-core
version: 1.6.8.1
version: 1.6.9
license: MIT
license-file: LICENSE
author: Michael Snoyman <michael@snoyman.com>