Mercurial > prosody-modules
comparison mod_atom/mod_atom.lua @ 3276:cb4b26221cf6
mod_atom: Set the proper Content-Type header for Atom (thanks MattJ)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 24 Aug 2018 23:59:54 +0200 |
parents | 25b4cad8fee4 |
children | 4a8fa0364f35 |
comparison
equal
deleted
inserted
replaced
3275:25b4cad8fee4 | 3276:cb4b26221cf6 |
---|---|
34 feed:reset(); | 34 feed:reset(); |
35 | 35 |
36 for i = #items, 1, -1 do | 36 for i = #items, 1, -1 do |
37 feed:add_direct_child(items[items[i]].tags[1]); | 37 feed:add_direct_child(items[items[i]].tags[1]); |
38 end | 38 end |
39 event.response.headers.content_type = "application/atom+xml"; | |
39 return tostring(feed); | 40 return tostring(feed); |
40 elseif items == "forbidden" then | 41 elseif items == "forbidden" then |
41 return 403; | 42 return 403; |
42 elseif items == "item-not-found" then | 43 elseif items == "item-not-found" then |
43 return 404; | 44 return 404; |