Mercurial > prosody-modules
comparison mod_auth_custom_http/mod_auth_custom_http.lua @ 3989:32d7f05e062f
mod_auth_custom_http: Unlock globals while loading socket.http
ltn12 tries to set a global and isn't caught by the require sandboxing.
Lua 5.2 issue?
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Thu, 23 Apr 2020 15:39:12 +0100 |
| parents | 94d8960385aa |
| children |
comparison
equal
deleted
inserted
replaced
| 3988:569f754bd126 | 3989:32d7f05e062f |
|---|---|
| 5 -- COPYING file in the source package for more information. | 5 -- COPYING file in the source package for more information. |
| 6 -- | 6 -- |
| 7 | 7 |
| 8 local new_sasl = require "util.sasl".new; | 8 local new_sasl = require "util.sasl".new; |
| 9 local json = require "util.json"; | 9 local json = require "util.json"; |
| 10 prosody.unlock_globals(); | |
| 10 local http = require "socket.http"; | 11 local http = require "socket.http"; |
| 12 prosody.lock_globals(); | |
| 11 | 13 |
| 12 local options = module:get_option("auth_custom_http"); | 14 local options = module:get_option("auth_custom_http"); |
| 13 local post_url = options and options.post_url; | 15 local post_url = options and options.post_url; |
| 14 assert(post_url, "No HTTP POST URL provided"); | 16 assert(post_url, "No HTTP POST URL provided"); |
| 15 | 17 |
