Preserve path when parsing urls.

This commit is contained in:
Diego Nehab 2017-03-20 16:56:15 -03:00
parent 1b4debffee
commit 47e644031f
2 changed files with 4 additions and 3 deletions

View File

@ -183,8 +183,9 @@ end
-- a stringing with the corresponding URL -- a stringing with the corresponding URL
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
function _M.build(parsed) function _M.build(parsed)
local ppath = _M.parse_path(parsed.path or "") --local ppath = _M.parse_path(parsed.path or "")
local url = _M.build_path(ppath) --local url = _M.build_path(ppath)
local url = parsed.path or ""
if parsed.params then url = url .. ";" .. parsed.params end if parsed.params then url = url .. ";" .. parsed.params end
if parsed.query then url = url .. "?" .. parsed.query end if parsed.query then url = url .. "?" .. parsed.query end
local authority = parsed.authority local authority = parsed.authority

View File

@ -1,4 +1,4 @@
AuthName "test-auth" AuthName "test-auth"
AuthType Basic AuthType Basic
AuthUserFile /Users/diego/impa/luasocket/test/auth/.htpasswd AuthUserFile /home/diego/impa/luasocket/test/auth/.htpasswd
Require valid-user Require valid-user