Skip to content

Commit f2304e5

Browse files
authored
Set errBody of defaultErrorFormatters.notFoundErrorFormatter in servant-server (#1790) (#1843)
1 parent 18b2ef4 commit f2304e5

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

changelog.d/pr-1843

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
synopsis: Set `errBody` of `defaultErrorFormatters.notFoundErrorFormatter`
2+
packages: servant-server
3+
prs: #1843
4+
issues: #1790
5+
description: {
6+
Set `errBody` of `defaultErrorFormatters.notFoundErrorFormatter` to avoid an empty body.
7+
}

servant-server/src/Servant/Server/Internal/ErrorFormatter.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ defaultErrorFormatters =
4848
{ bodyParserErrorFormatter = err400Formatter
4949
, urlParseErrorFormatter = err400Formatter
5050
, headerParseErrorFormatter = err400Formatter
51-
, notFoundErrorFormatter = const err404
51+
, notFoundErrorFormatter = const err404{errBody = "404 Not Found"}
5252
}
5353

5454
-- | A custom formatter for errors produced by parsing combinators like

0 commit comments

Comments
 (0)