changeset 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 836e4e110c71
children 4d27552ac443
files mod_pastebin/mod_pastebin.lua
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_pastebin/mod_pastebin.lua	Tue Oct 23 13:32:44 2012 +0000
+++ b/mod_pastebin/mod_pastebin.lua	Thu Oct 25 00:15:23 2012 +0000
@@ -56,7 +56,8 @@
 
 function handle_request(event, pasteid)
 	if not pasteid or not pastes[pasteid] then
-		return "Invalid paste id, perhaps it expired?";
+		event.response.headers = default_headers;
+		return event.response:send("Invalid paste id, perhaps it expired?");
 	end
 	
 	--module:log("debug", "Received request, replying: %s", pastes[pasteid].text);