comparison mod_pastebin/mod_pastebin.lua @ 852:6c2b77f97e62

mod_pastebin: provide correct content-type on invalid pastes warnings too.
author Marco Cirillo <maranda@lightwitch.org>
date Thu, 25 Oct 2012 00:15:23 +0000
parents 4e43becc3bbe
children 15e2c4fd26a0
comparison
equal deleted inserted replaced
851:836e4e110c71 852:6c2b77f97e62
54 return base_url..uuid; 54 return base_url..uuid;
55 end 55 end
56 56
57 function handle_request(event, pasteid) 57 function handle_request(event, pasteid)
58 if not pasteid or not pastes[pasteid] then 58 if not pasteid or not pastes[pasteid] then
59 return "Invalid paste id, perhaps it expired?"; 59 event.response.headers = default_headers;
60 return event.response:send("Invalid paste id, perhaps it expired?");
60 end 61 end
61 62
62 --module:log("debug", "Received request, replying: %s", pastes[pasteid].text); 63 --module:log("debug", "Received request, replying: %s", pastes[pasteid].text);
63 64
64 return pastes[pasteid]; 65 return pastes[pasteid];