Software / code / prosody
Comparison
plugins/mod_http.lua @ 5092:a89f8f2f2943
mod_http: Don't produce paths with double / if a module is set to serve /
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Tue, 21 Aug 2012 21:03:20 +0200 |
| parent | 4915:3fbc01d1fc5a |
| child | 5093:1ce9e8068dda |
comparison
equal
deleted
inserted
replaced
| 5091:dbc483d06a07 | 5092:a89f8f2f2943 |
|---|---|
| 27 if not method then -- No path specified, default to "" (base path) | 27 if not method then -- No path specified, default to "" (base path) |
| 28 method, path = key, ""; | 28 method, path = key, ""; |
| 29 end | 29 end |
| 30 if method:sub(1,1) == "/" then | 30 if method:sub(1,1) == "/" then |
| 31 return nil; | 31 return nil; |
| 32 end | |
| 33 if app_path == "/" and path:sub(1,1) == "/" then | |
| 34 app_path = ""; | |
| 32 end | 35 end |
| 33 return method:upper().." "..host..app_path..path; | 36 return method:upper().." "..host..app_path..path; |
| 34 end | 37 end |
| 35 | 38 |
| 36 local function get_base_path(host_module, app_name, default_app_path) | 39 local function get_base_path(host_module, app_name, default_app_path) |