Skip to content

Conversation

tom2nonames
Copy link

No description provided.


function Response:ljpack(data)
self:set_header('Content-Type', 'application/ljpack')
self:__send(utils.ljpack_encode(data))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's enough to call the already existing self:_send directly.

Comment on lines +119 to +123
function Response:__send(content)
ngx.status = self.http_status or 200
ngx.print(content)
end

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

local smatch = string.match
local table_insert = table.insert
local json = require("cjson")
local st = require("string.buffer")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the new api string.buffer was introduced from OpenResty 1.12.4.1 onwards, it would be nice to have a fallback to be compatible with older versions of OpenResty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants