Skip to content

Commit

Permalink
Merge pull request #1565 from StevenXL/add-send-response-no-content
Browse files Browse the repository at this point in the history
Add sendResponseNoContent.
  • Loading branch information
snoyberg committed Dec 3, 2018
2 parents 6eb91bd + 2a9bef3 commit 7a2c536
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions yesod-core/ChangeLog.md
@@ -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)
Expand Down
7 changes: 7 additions & 0 deletions yesod-core/Yesod/Core/Handler.hs
Expand Up @@ -99,6 +99,7 @@ module Yesod.Core.Handler
-- ** Type specific response with custom status
, sendStatusJSON
, sendResponseCreated
, sendResponseNoContent
, sendWaiResponse
, sendWaiApplication
, sendRawResponse
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion yesod-core/yesod-core.cabal
@@ -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>
Expand Down

0 comments on commit 7a2c536

Please sign in to comment.