Skip to content

Commit

Permalink
remove gzip module in utils.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
chronolaw committed Nov 10, 2023
1 parent 249f3cd commit 090cf3f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion kong/tools/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,6 @@ _M.topological_sort = topological_sort

do
local modules = {
"kong.tools.gzip",
"kong.tools.table",
"kong.tools.sha256",
"kong.tools.yield",
Expand Down
2 changes: 2 additions & 0 deletions spec/01-unit/05-utils_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,8 @@ describe("Utils", function()
end)

describe("gzip_[de_in]flate()", function()
local utils = require "kong.tools.gzip"

it("empty string", function()
local gz = assert(utils.deflate_gzip(""))
assert.equal(utils.inflate_gzip(gz), "")
Expand Down
2 changes: 1 addition & 1 deletion spec/01-unit/19-hybrid/03-compat_spec.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
local compat = require("kong.clustering.compat")
local helpers = require ("spec.helpers")
local declarative = require("kong.db.declarative")
local inflate_gzip = require("kong.tools.utils").inflate_gzip
local inflate_gzip = require("kong.tools.gzip").inflate_gzip
local cjson_decode = require("cjson.safe").decode
local ssl_fixtures = require ("spec.fixtures.ssl")

Expand Down
4 changes: 3 additions & 1 deletion spec/helpers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3788,6 +3788,8 @@ local function clustering_client(opts)
assert(opts.cert)
assert(opts.cert_key)

local inflate_gzip = require("kong.tools.gzip").inflate_gzip

local c = assert(ws_client:new())
local uri = "wss://" .. opts.host .. ":" .. opts.port ..
"/v1/outlet?node_id=" .. (opts.node_id or utils.uuid()) ..
Expand Down Expand Up @@ -3820,7 +3822,7 @@ local function clustering_client(opts)
c:close()

if typ == "binary" then
local odata = assert(utils.inflate_gzip(data))
local odata = assert(inflate_gzip(data))
local msg = assert(cjson.decode(odata))
return msg

Expand Down

0 comments on commit 090cf3f

Please sign in to comment.