support openresty 1.29.2#231
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the Nginx and Lua Nginx module version checks to support newer releases, specifically adding support for Nginx versions 1.27.1 and 1.29.2, and extending the Lua module version range to 1.00.30. Feedback suggests adding a safety check for ngx_lua_version to prevent a potential runtime error when the version is nil.
| ngx.config.ngx_lua_version | ||
|
|
||
| if ngx_lua_version >= 10019 and ngx_lua_version <= 10028 then | ||
| if ngx_lua_version >= 10019 and ngx_lua_version <= 10030 then |
There was a problem hiding this comment.
If ngx_lua_version is nil (which can happen if ngx.config.ngx_lua_version is missing), this comparison will throw a runtime error: attempt to compare number with nil. Although this is existing logic, since you are modifying this line, it's a good opportunity to add a safety check to ensure ngx_lua_version is truthy before performing the comparison. This ensures the code gracefully falls through to the else block which handles the nil case with a descriptive error message.
if ngx_lua_version and ngx_lua_version >= 10019 and ngx_lua_version <= 10030 then
structs appear to be the same, only need to bump the constraints