这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions server/src-lib/Hasura/GraphQL/Execute.hs
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,8 @@ execRemoteGQ reqId userInfo reqHdrs q rsi opDef = do
liftIO $ logGraphqlQuery logger $ QueryLog q Nothing reqId
res <- liftIO $ try $ Wreq.postWith options (show url) (J.toJSON q)
resp <- either httpThrow return res
let cookieHdr = getCookieHdr (resp ^? Wreq.responseHeader "Set-Cookie")
respHdrs = Just $ mkRespHeaders cookieHdr
let cookieHdrs = getCookieHdr (resp ^.. Wreq.responseHeader "Set-Cookie")
respHdrs = Just $ mkRespHeaders cookieHdrs
return $ HttpResponse (encJFromLBS $ resp ^. Wreq.responseBody) respHdrs

where
Expand All @@ -398,7 +398,7 @@ execRemoteGQ reqId userInfo reqHdrs q rsi opDef = do
in map (\(k, v) -> (CI.mk $ CS.cs k, CS.cs v)) $
filter (not . isUserVar . fst) txHdrs

getCookieHdr = maybe [] (\h -> [("Set-Cookie", h)])
getCookieHdr = fmap (\h -> ("Set-Cookie", h))

mkRespHeaders hdrs =
map (\(k, v) -> Header (bsToTxt $ CI.original k, bsToTxt v)) hdrs