# HG changeset patch # User JC Brand # Date 1490088673 0 # Node ID 96eb1c4f9ff7b76833054b2941f79acd948a84a7 # Parent a11568bfaf4c442affe55f5231853998025906db mod_auth_http_async: Use "net.http" for async case. diff -r a11568bfaf4c -r 96eb1c4f9ff7 mod_auth_http_async/mod_auth_http_async.lua --- 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;