Add ability to map GUC to http response headers

This commit is contained in:
steve-chavez
2017-10-18 17:41:55 -05:00
committed by Steve Chávez
parent 38de56de4a
commit b9a591aecb
7 changed files with 109 additions and 17 deletions
+6
View File
@@ -10,6 +10,7 @@ module PostgREST.Error (
, binaryFieldError
, connectionLostError
, encodeError
, gucHeadersError
) where
import Protolude
@@ -79,6 +80,11 @@ binaryFieldError =
simpleError HT.status406 [] (toS (toMime CTOctetStream) <>
" requested but a single column was not selected")
gucHeadersError :: Response
gucHeadersError =
simpleError HT.status500 []
"response.headers guc must be a JSON array composed of objects with a single key and a string value"
connectionLostError :: Response
connectionLostError =
simpleError HT.status503 [] "Database connection lost, retrying the connection."