Skip to content

Commit

Permalink
httputil: do not error when parameter is incorrectly encoded (#337)
Browse files Browse the repository at this point in the history
This should pass the parameter as is.
  • Loading branch information
clandmeter authored and kernelsauce committed Nov 2, 2018
1 parent 2c098a4 commit 7a898b7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion turbo/httputil.lua
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,11 @@ function httputil.HTTPParser:get_status_code()
return self.tpw.parser.status_code, status_codes[self.status_code]
end

local function _unescape(s) return string.char(tonumber(s,16)) end
local function _unescape(s)
local n = tonumber(s,16)
if n then return string.char(n) end
end

--- Internal function to parse ? and & separated key value fields.
-- @param uri (String)
local function _parse_arguments(uri)
Expand Down

0 comments on commit 7a898b7

Please sign in to comment.