Merge pull request #1565 from StevenXL/add-send-response-no-content
Add sendResponseNoContent.
This commit is contained in:
commit
7a2c5367e7
@ -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)
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user