comparison mod_onions/mod_onions.lua @ 2303:db7c80c2d681

mod_onions: Escape period in pattern
author Kim Alvefur <zash@zash.se>
date Fri, 23 Sep 2016 11:54:30 +0200
parents 720b291cb340
children a881494238af
comparison
equal deleted inserted replaced
2302:12249570352f 2303:db7c80c2d681
234 local stanza = event.stanza; 234 local stanza = event.stanza;
235 local to_host = event.to_host; 235 local to_host = event.to_host;
236 local onion_host = nil; 236 local onion_host = nil;
237 local onion_port = nil; 237 local onion_port = nil;
238 238
239 if not to_host:find(".onion(.?)$") then 239 if not to_host:find("%.onion(%.?)$") then
240 if onions_map[to_host] then 240 if onions_map[to_host] then
241 if type(onions_map[to_host]) == "string" then 241 if type(onions_map[to_host]) == "string" then
242 onion_host = onions_map[to_host]; 242 onion_host = onions_map[to_host];
243 else 243 else
244 onion_host = onions_map[to_host].host; 244 onion_host = onions_map[to_host].host;