Mercurial > prosody-hg
comparison plugins/mod_http.lua @ 7518:829ebe806e82
mod_http: Fix indentation in redir_handler
| author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
|---|---|
| date | Sun, 24 Jul 2016 17:36:53 +0100 |
| parents | a5a080c12c96 |
| children | 2481ebc7f715 |
comparison
equal
deleted
inserted
replaced
| 7517:e81ceca529c5 | 7518:829ebe806e82 |
|---|---|
| 45 :gsub("%$(%w+)", { host = host_module.host }); | 45 :gsub("%$(%w+)", { host = host_module.host }); |
| 46 end | 46 end |
| 47 | 47 |
| 48 local function redir_handler(event) | 48 local function redir_handler(event) |
| 49 event.response.headers.location = event.request.path.."/"; | 49 event.response.headers.location = event.request.path.."/"; |
| 50 if event.request.url.query then | 50 if event.request.url.query then |
| 51 event.response.headers.location = event.response.headers.location .. "?" .. event.request.url.query | 51 event.response.headers.location = event.response.headers.location .. "?" .. event.request.url.query |
| 52 end | 52 end |
| 53 return 301; | 53 return 301; |
| 54 end | 54 end |
| 55 | 55 |
| 56 local ports_by_scheme = { http = 80, https = 443, }; | 56 local ports_by_scheme = { http = 80, https = 443, }; |
| 57 | 57 |
