From f2d882abc9f8be333b8d616b56210e9de388580d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BD=97=E6=B3=BD=E8=BD=A9?= Date: Mon, 10 Nov 2025 18:01:57 +0800 Subject: [PATCH] Update ngx.escape_uri definition to match latest lua-nginx-module --- library/ngx.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/library/ngx.lua b/library/ngx.lua index b7b9af4..f970a51 100644 --- a/library/ngx.lua +++ b/library/ngx.lua @@ -765,10 +765,14 @@ function ngx.timer.at(delay, callback, ...) end function ngx.unescape_uri(str) end --- Escape `str` as a URI component. +--- This function accepts an optional type argument. It accepts the following values (defaults to 2): +--- 0: escapes str as a full URI. And the characters (space), #, %, ?, 0x00 ~ 0x1F, 0x7F ~ 0xFF will be escaped. +--- 2: escape str as a URI component. All characters except alphabetic characters, digits, -, ., _, ~ will be encoded as %XX. --- ---@param str string +---@param type? integer ---@return string -function ngx.escape_uri(str) end +function ngx.escape_uri(str, type) end --- Returns the binary form of the SHA-1 digest of the `str` argument. ---