Skip to content

Commit

Permalink
chore(url): Remove unnecessary parentheses
Browse files Browse the repository at this point in the history
Signed-off-by: Jianhui Zhao <[email protected]>
  • Loading branch information
zhaojh329 committed Feb 2, 2024
1 parent c07b86b commit be9f824
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions http/url.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ local M = {}
local tonumber = tonumber

function M.escape(s)
return (string.gsub(s, "([^A-Za-z0-9_])", function(c)
return string.gsub(s, "([^A-Za-z0-9_])", function(c)
return string.format("%%%02x", string.byte(c))
end))
end)
end

function M.unescape(s)
return (string.gsub(s, "%%(%x%x)", function(hex)
return string.gsub(s, "%%(%x%x)", function(hex)
return string.char(tonumber(hex, 16))
end))
end)
end

-- <scheme>://<user>:<password>@<host>:<port>/<path>;<params>?<query>#<frag>
Expand Down

0 comments on commit be9f824

Please sign in to comment.