aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Nehab <diego.nehab@gmail.com>2017-03-20 16:56:15 -0300
committerDiego Nehab <diego.nehab@gmail.com>2017-03-20 16:56:15 -0300
commit47e644031fed0ced1066ff843c9b42d45b54042d (patch)
tree53fe5cd2ffb1f43e726c6e11c89c8a8ebd8e120f
parent1b4debffee52e69a2d523cea5d2c308e7cb3b187 (diff)
downloadluasocket-47e644031fed0ced1066ff843c9b42d45b54042d.tar.gz
luasocket-47e644031fed0ced1066ff843c9b42d45b54042d.tar.bz2
luasocket-47e644031fed0ced1066ff843c9b42d45b54042d.zip
Preserve path when parsing urls.
-rw-r--r--src/url.lua5
-rw-r--r--test/auth/.htaccess2
2 files changed, 4 insertions, 3 deletions
diff --git a/src/url.lua b/src/url.lua
index eb094d5..1e5a3f6 100644
--- a/src/url.lua
+++ b/src/url.lua
@@ -183,8 +183,9 @@ end
183-- a stringing with the corresponding URL 183-- a stringing with the corresponding URL
184----------------------------------------------------------------------------- 184-----------------------------------------------------------------------------
185function _M.build(parsed) 185function _M.build(parsed)
186 local ppath = _M.parse_path(parsed.path or "") 186 --local ppath = _M.parse_path(parsed.path or "")
187 local url = _M.build_path(ppath) 187 --local url = _M.build_path(ppath)
188 local url = parsed.path or ""
188 if parsed.params then url = url .. ";" .. parsed.params end 189 if parsed.params then url = url .. ";" .. parsed.params end
189 if parsed.query then url = url .. "?" .. parsed.query end 190 if parsed.query then url = url .. "?" .. parsed.query end
190 local authority = parsed.authority 191 local authority = parsed.authority
diff --git a/test/auth/.htaccess b/test/auth/.htaccess
index bb2794a..2509ae3 100644
--- a/test/auth/.htaccess
+++ b/test/auth/.htaccess
@@ -1,4 +1,4 @@
1AuthName "test-auth" 1AuthName "test-auth"
2 AuthType Basic 2 AuthType Basic
3 AuthUserFile /Users/diego/impa/luasocket/test/auth/.htpasswd 3 AuthUserFile /home/diego/impa/luasocket/test/auth/.htpasswd
4 Require valid-user 4 Require valid-user