Software /
code /
prosody-modules
Changeset
76:1fc4e8dc66a6
mod_pastebin: Send Content-Type header to specify plain UTF-8 text
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sun, 01 Nov 2009 01:24:27 +0000 |
parents | 75:3c7189e26848 |
children | 77:85b8622ccffd |
files | mod_pastebin/mod_pastebin.lua |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mod_pastebin/mod_pastebin.lua Sun Nov 01 01:10:02 2009 +0000 +++ b/mod_pastebin/mod_pastebin.lua Sun Nov 01 01:24:27 2009 +0000 @@ -14,13 +14,14 @@ local expire_after = math.floor((config.get(module.host, "core", "pastebin_expire_after") or 24) * 3600); local pastes = {}; +local default_headers = { ["Content-Type"] = "text/plain; charset=utf-8" }; local xmlns_xhtmlim = "http://jabber.org/protocol/xhtml-im"; local xmlns_xhtml = "http://www.w3.org/1999/xhtml"; function pastebin_text(text) local uuid = uuid_new(); - pastes[uuid] = { text = text, time = os_time() }; + pastes[uuid] = { body = text, time = os_time(), headers = default_headers }; pastes[#pastes+1] = uuid; if not pastes[2] then -- No other pastes, give the timer a kick add_task(expire_after, expire_pastes); @@ -36,7 +37,7 @@ --module:log("debug", "Received request, replying: %s", pastes[pasteid].text); - return pastes[pasteid].text; + return pastes[pasteid]; end function check_message(data)