comparison mod_pubsub_hub/mod_pubsub_hub.lua @ 3021:4cec8b7aed6d

mod_pubsub_hub: Use the correct MIME type for Atom feeds
author Kim Alvefur <zash@zash.se>
date Sun, 20 May 2018 17:09:10 +0200
parents e9d164e694e7
children
comparison
equal deleted inserted replaced
3020:ec671ad1a8a9 3021:4cec8b7aed6d
153 -- COMPAT This is required by the PubSubHubbub spec. 153 -- COMPAT This is required by the PubSubHubbub spec.
154 content = st.stanza("feed", {xmlns=xmlns_atom}):add_child(content); 154 content = st.stanza("feed", {xmlns=xmlns_atom}):add_child(content);
155 end 155 end
156 local body = tostring(content); 156 local body = tostring(content);
157 local headers = { 157 local headers = {
158 ["Content-Type"] = "application/xml", 158 ["Content-Type"] = "application/atom+xml",
159 }; 159 };
160 if subscription.secret then 160 if subscription.secret then
161 headers["X-Hub-Signature"] = "sha1="..hmac_sha1(subscription.secret, body, true); 161 headers["X-Hub-Signature"] = "sha1="..hmac_sha1(subscription.secret, body, true);
162 end 162 end
163 http_request(subscription.callback, { method = "POST", body = body, headers = headers }, function(body, code) 163 http_request(subscription.callback, { method = "POST", body = body, headers = headers }, function(body, code)