Mercurial > prosody-hg
comparison plugins/mod_http.lua @ 9336:9e8d7d461c7d
mod_http: Hook the host-less event if hooked from a global module
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Fri, 21 Sep 2018 21:19:44 +0200 |
| parents | 2dc7490899ae |
| children | 9beb767295d4 |
comparison
equal
deleted
inserted
replaced
| 9335:2dc7490899ae | 9336:9e8d7d461c7d |
|---|---|
| 36 return nil; | 36 return nil; |
| 37 end | 37 end |
| 38 if app_path == "/" and path:sub(1,1) == "/" then | 38 if app_path == "/" and path:sub(1,1) == "/" then |
| 39 app_path = ""; | 39 app_path = ""; |
| 40 end | 40 end |
| 41 return method:upper().." "..host..app_path..path; | 41 if host == "*" then |
| 42 return method:upper().." "..app_path..path; | |
| 43 else | |
| 44 return method:upper().." "..host..app_path..path; | |
| 45 end | |
| 42 end | 46 end |
| 43 | 47 |
| 44 local function get_base_path(host_module, app_name, default_app_path) | 48 local function get_base_path(host_module, app_name, default_app_path) |
| 45 return (normalize_path(host_module:get_option("http_paths", {})[app_name] -- Host | 49 return (normalize_path(host_module:get_option("http_paths", {})[app_name] -- Host |
| 46 or module:get_option("http_paths", {})[app_name] -- Global | 50 or module:get_option("http_paths", {})[app_name] -- Global |
