From 3a817a56ebcbdf060076a8f056ab86816569bc88 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Wed, 8 Nov 2023 23:27:58 +0300 Subject: [PATCH] fix(url): Avoid fragment being part of authority, allows parsing empty paths --- src/url.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/url.lua b/src/url.lua index 8528cd5..aef1698 100644 --- a/src/url.lua +++ b/src/url.lua @@ -152,7 +152,7 @@ function _M.parse(url, default) url = string.gsub(url, "^([%w][%w%+%-%.]*)%:", function(s) parsed.scheme = s; return "" end) -- get authority - url = string.gsub(url, "^//([^/%?]*)", function(n) + url = string.gsub(url, "^//([^/%?#]*)", function(n) parsed.authority = n return "" end)