We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
response
1 parent f2ab8ee commit 6ee9c8fCopy full SHA for 6ee9c8f
1 file changed
src/lua/cURL.lua
@@ -221,15 +221,19 @@ local remove_handle = wrap_function("remove_handle")
221
local function make_iterator(self)
222
local curl = require "lcurl.safe"
223
224
- local buffers = {_ = {}} do
+ local buffers = {resp = {}, _ = {}} do
225
226
function buffers:append(e, ...)
227
- if not self._[e] then
228
- self._[e] = {
229
- -- {"response", e:getinfo_response_code()}
230
- }
231
- end
+ local resp = assert(e:getinfo_response_code())
+ if not self._[e] then self._[e] = {} end
+
232
local b = self._[e]
+ if self.resp[e] ~= resp then
233
+ b[#b + 1] = {"response", resp}
234
+ self.resp[e] = resp
235
+ end
236
237
b[#b + 1] = {...}
238
end
239
0 commit comments