diff options
author | Waqas Hussain <waqas20@gmail.com> | 2012-04-22 23:44:21 +0500 |
---|---|---|
committer | Waqas Hussain <waqas20@gmail.com> | 2012-04-22 23:44:21 +0500 |
commit | 608d074ba071a82cb409eb5a8b7aa5b5c4bd4eb4 (patch) | |
tree | 90892d5b5594acbec8c71314ef370a3d3147e79e | |
parent | e5b647c77cc4360aa843b7d81e70a3d84ddbfb95 (diff) | |
download | prosody-608d074ba071a82cb409eb5a8b7aa5b5c4bd4eb4.tar.gz prosody-608d074ba071a82cb409eb5a8b7aa5b5c4bd4eb4.zip |
net.http.server: Fix legacy net.httpserver fallback (httpserver is no longer a global).
-rw-r--r-- | net/http/server.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/http/server.lua b/net/http/server.lua index 1f61c7b9..3a0cb53a 100644 --- a/net/http/server.lua +++ b/net/http/server.lua @@ -13,6 +13,7 @@ local debug = debug; local tostring = tostring; local codes = require "net.http.codes"; local _G = _G; +local legacy_httpserver = require "net.httpserver"; local _M = {}; @@ -159,9 +160,9 @@ end function _M.legacy_handler(request, response) log("debug", "Invoking legacy handler"); local base = request.path:match("^/([^/?]+)"); - local legacy_server = _G.httpserver and _G.httpserver.new.http_servers[5280]; + local legacy_server = legacy_httpserver and legacy_httpserver.new.http_servers[5280]; local handler = legacy_server and legacy_server.handlers[base]; - if not handler then handler = _G.httpserver and _G.httpserver.set_default_handler.default_handler; end + if not handler then handler = legacy_httpserver and legacy_httpserver.set_default_handler.default_handler; end if handler then -- add legacy properties to request object request.url = { path = request.path }; |