Skip to content

Commit 654ea15

Browse files
Mikhail Kirichenkopintsized
authored andcommitted
Support literal ipv6 addresses
1 parent c2faeb4 commit 654ea15

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/resty/http.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ end
256256
function _M.parse_uri(_, uri, query_in_path)
257257
if query_in_path == nil then query_in_path = true end
258258

259-
local m, err = ngx_re_match(uri, [[^(?:(http[s]?):)?//([^:/\?]+)(?::(\d+))?([^\?]*)\??(.*)]], "jo")
259+
local m, err = ngx_re_match(uri, [[^(?:(http[s]?):)?//((?:[^\[\]:/\?]+)|(?:\[.+\]))(?::(\d+))?([^\?]*)\??(.*)]], "jo")
260260

261261
if not m then
262262
if err then

0 commit comments

Comments
 (0)