mod_auth_http_async: Use "net.http" for async case.
--- a/mod_auth_http_async/mod_auth_http_async.lua Tue Mar 21 09:14:03 2017 +0000
+++ b/mod_auth_http_async/mod_auth_http_async.lua Tue Mar 21 09:31:13 2017 +0000
@@ -8,8 +8,6 @@
--
local new_sasl = require "util.sasl".new;
-local http = require "socket.http";
-local https = require "ssl.https";
local base64 = require "util.encodings".base64.encode;
local have_async, async = pcall(require, "util.async");
@@ -30,6 +28,7 @@
end
local function async_http_auth(url, username, password)
+ local http = require "net.http";
local wait, done = async.waiter();
local content, code, request, response;
local ex = {
@@ -51,6 +50,8 @@
end
local function sync_http_auth(url)
+ local http = require "socket.http";
+ local https = require "ssl.https";
local request;
if string.sub(url, 1, string.len('https')) == 'https' then
request = https.request;