diff options
Diffstat (limited to 'src/url.lua')
-rw-r--r-- | src/url.lua | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/url.lua b/src/url.lua index 8c591c0..2441268 100644 --- a/src/url.lua +++ b/src/url.lua | |||
@@ -4,16 +4,12 @@ | |||
4 | -- Author: Diego Nehab | 4 | -- Author: Diego Nehab |
5 | -- Conforming to: RFC 2396, LTN7 | 5 | -- Conforming to: RFC 2396, LTN7 |
6 | -- RCS ID: $Id$ | 6 | -- RCS ID: $Id$ |
7 | ---------------------------------------------------------------------------- | 7 | ----------------------------------------------------------------------------- |
8 | -- make sure LuaSocket is loaded | ||
9 | require("socket") | ||
10 | -- get LuaSocket namespace | ||
11 | local socket = _G[LUASOCKET_LIBNAME] | ||
12 | 8 | ||
13 | -- create url namespace inside LuaSocket namespace | 9 | ----------------------------------------------------------------------------- |
14 | local url = socket.url or {} | 10 | -- Setup namespace |
15 | socket.url = url | 11 | ----------------------------------------------------------------------------- |
16 | -- make all module globals fall into url namespace | 12 | local url = {} |
17 | setmetatable(url, { __index = _G }) | 13 | setmetatable(url, { __index = _G }) |
18 | setfenv(1, url) | 14 | setfenv(1, url) |
19 | 15 | ||
@@ -275,3 +271,5 @@ function build_path(parsed, unsafe) | |||
275 | if parsed.is_absolute then path = "/" .. path end | 271 | if parsed.is_absolute then path = "/" .. path end |
276 | return path | 272 | return path |
277 | end | 273 | end |
274 | |||
275 | return url | ||