Revert "fix: Always handle the extra response outside of stream, such as the exceptions from bedrock (#1526)" (#1569)
This reverts commit f9ab6934d2.
This commit is contained in:
@@ -246,9 +246,7 @@ function M.curl(opts)
|
||||
end
|
||||
|
||||
local function parse_response_without_stream(data)
|
||||
if provider.parse_response_without_stream then
|
||||
provider:parse_response_without_stream(data, current_event_state, handler_opts)
|
||||
end
|
||||
provider:parse_response_without_stream(data, current_event_state, handler_opts)
|
||||
end
|
||||
|
||||
local completed = false
|
||||
@@ -356,8 +354,8 @@ function M.curl(opts)
|
||||
end)
|
||||
end
|
||||
|
||||
-- Always handle the extra response outside of stream, such as the exceptions from bedrock
|
||||
if result.status == 200 then
|
||||
-- If stream is not enabled, then handle the response here
|
||||
if provider:is_disable_stream() and result.status == 200 then
|
||||
vim.schedule(function()
|
||||
completed = true
|
||||
parse_response_without_stream(result.body)
|
||||
|
||||
Reference in New Issue
Block a user