add params support in options

This commit is contained in:
Yuzo 2015-01-22 13:12:48 +08:00
parent b6d4f32dcc
commit 3dbdff7096

View file

@ -97,7 +97,11 @@ end
function request_raw(uri, options)
options = options or {}
local pr, auth, host, port, path
if options.params then
uri = uri .. '?' .. http.urlencode_params(options.params)
end
if uri:find("%[") then
if uri:find("@") then
pr, auth, host, port, path = uri:match("(%w+)://(.+)@(%b[]):?([0-9]*)(.*)")