Comparison

mod_http_pep_avatar/mod_http_pep_avatar.lua @ 3575:00bdecb12779

mod_http_pep_avatar: Return a message instead of 404 for base path
author Kim Alvefur <zash@zash.se>
date Sun, 05 May 2019 09:22:30 +0200
parent 3433:213679266dcb
child 4038:02d238799537
comparison
equal deleted inserted replaced
3574:f478e325529e 3575:00bdecb12779
10 10
11 module:depends("http") 11 module:depends("http")
12 module:provides("http", { 12 module:provides("http", {
13 route = { 13 route = {
14 ["GET /*"] = function (event, user) 14 ["GET /*"] = function (event, user)
15 if user == "" then
16 return [[<h1>Hello from mod_http_pep_avatar</h1><p>This module provides access to public avatars of local users.</p>]];
17 end;
18
15 local request, response = event.request, event.response; 19 local request, response = event.request, event.response;
16 local actor = request.ip; 20 local actor = request.ip;
17 21
18 local prepped = nodeprep(user); 22 local prepped = nodeprep(user);
19 if not prepped then return 400; end 23 if not prepped then return 400; end