lua-resty-http
lua-resty-http copied to clipboard
some wrong with url regex
in http.lua at line 260, the parse regex failed when the url like "xxx.yyy.com/config/list"; the fixed regex may like [[^(?:(http[s]?)://)?...]]
I'm passing the same situation.
local res, err = httpc:request_uri("http://example.com/helloworld", {
method = "GET",
})```
returns bad url error.
And it happens when the method make the match with this regex
https://github.com/ledgetech/lua-resty-http/blob/5e70eaa420abf44f3ea4e8efb2feccdf8422ed9f/lib/resty/http.lua#L258
The tests would seem to disagree with this: https://github.com/ledgetech/lua-resty-http/blob/master/t/18-parse_uri.t
in http.lua at line 260, the parse regex failed when the url like "xxx.yyy.com/config/list"; the fixed regex may like [[^(?:(http[s]?)://)?...]]
Note that if you want to use a "schemaless" URI you'll need to use the correct syntax: //xxx.yyy.com/config/list