Skip to content

Commit

Permalink
fix(globalpatches): moved require kong.constants into the closure (#…
Browse files Browse the repository at this point in the history
…12328)

This is necessary because EE has changed `package.path` in this closure,
and we continue leave that at the top level of this file, EE's e2e
test will report the following error:

```
stack traceback:
        /usr/local/share/lua/5.1/kong/constants.lua:8: in main chunk
        [C]: in function 'require'
        /usr/local/share/lua/5.1/kong/globalpatches.lua:8: in main chunk
        [C]: in function 'require'
        /usr/local/bin/kong:6: in function 'file_gen'
        init_worker_by_lua(nginx.conf:118):46: in function <init_worker_by_lua(nginx.conf:118):44>
        [C]: in function 'xpcall'
        init_worker_by_lua(nginx.conf:118):53: in function <init_worker_by_lua(nginx.conf:118):51>
```
  • Loading branch information
ms2008 authored Jan 11, 2024
1 parent 43387b4 commit f955b6e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions kong/globalpatches.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
local constants = require "kong.constants"

local ran_before


Expand All @@ -15,6 +13,7 @@ return function(options)

options = options or {}
local meta = require "kong.meta"
local constants = require "kong.constants"


local cjson_safe = require("cjson.safe")
Expand Down

0 comments on commit f955b6e

Please sign in to comment.