Skip to content

Commit 1c3ea60

Browse files
committed
fix(openssl) typo in luaossl_compat #1
1 parent 9f1fe43 commit 1c3ea60

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Table of Contents
1212
- [Status](#status)
1313
- [Synopsis](#synopsis)
1414
* [resty.openssl](#restyopenssl)
15-
+ [openssl.luaossl_compact](#opensslluaossl-compact)
15+
+ [openssl.luaossl_compat](#opensslluaossl-compat)
1616
* [resty.openssl.version](#restyopensslversion)
1717
+ [version_num](#version_num)
1818
+ [version_text](#version_text)
@@ -174,7 +174,7 @@ local _M = {
174174

175175
### openssl.luaossl_compat
176176

177-
**syntax**: *openssl.luaossl_compact()*
177+
**syntax**: *openssl.luaossl_compat()*
178178

179179
Provides `luaossl` flavored API which uses *camelCase* naming; user can expect drop in replacement.
180180

lib/resty/openssl.lua

+4-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ local _M = {
2525

2626
_M.bignum = _M.bn
2727

28-
function _M.luaossl_compact()
28+
function _M.luaossl_compat()
2929
for mod, tbl in pairs(_M) do
3030
if type(tbl) == 'table' then
3131
-- luaossl always error() out
@@ -102,4 +102,7 @@ function _M.luaossl_compact()
102102
end
103103
end
104104

105+
-- we made a typo sometime, this is going to be removed in next major release
106+
_M.luaossl_compact = _M.luaossl_compat
107+
105108
return _M

t/openssl.t

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ __DATA__
3030
[error]
3131

3232

33-
=== TEST 2: Luaossl compact pattern
33+
=== TEST 2: Luaossl compat pattern
3434
--- http_config eval: $::HttpConfig
3535
--- config
3636
location =/t {
3737
content_by_lua_block {
3838
local openssl = require("resty.openssl")
39-
openssl.luaossl_compact()
39+
openssl.luaossl_compat()
4040
local pkey = require("resty.openssl.pkey")
4141
local pok, perr = pcall(pkey.new, "not a key")
4242
ngx.say(pok)

0 commit comments

Comments
 (0)