mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-14 17:02:49 +03:00
server: reintroduce Content-Type
header for errors
Fix regression introduced by hasura/graphql-engine-mono#7444. PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7827 GitOrigin-RevId: 468f2a53f44b732c09f09ca71a3a2c4b38e4e360
This commit is contained in:
parent
5f9e70a527
commit
36a9de5215
@ -400,8 +400,9 @@ mkSpockAction serverCtx@ServerCtx {..} qErrEncoder qErrModifier apiHandler = do
|
||||
let httpLogMetadata = buildHttpLogMetadata @m3 emptyHttpLogGraphQLInfo extraUserInfo
|
||||
jsonResponse = J.encode $ qErrEncoder includeInternal qErr
|
||||
contentLength = ("Content-Length", B8.toStrict $ BB.toLazyByteString $ BB.int64Dec $ BL.length jsonResponse)
|
||||
allHeaders = [contentLength, jsonHeader]
|
||||
lift $ logHttpError (_lsLogger scLoggers) scLoggingSettings userInfo reqId waiReq req qErr headers httpLogMetadata
|
||||
setHeader contentLength
|
||||
mapM_ setHeader allHeaders
|
||||
Spock.setStatus $ qeStatus qErr
|
||||
Spock.lazyBytes jsonResponse
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user