changeset 5579:bc292c84f56c

mod_pubsub_feeds: Specify acceptable formats in Accept header Don't need to a condition on the etag, if it's nil it's left out.
author Kim Alvefur <zash@zash.se>
date Sun, 25 Jun 2023 23:53:15 +0200
parents b9821e9a21a2
children feadbd481285
files mod_pubsub_feeds/mod_pubsub_feeds.lua
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mod_pubsub_feeds/mod_pubsub_feeds.lua	Sun Jun 25 20:15:44 2023 +0200
+++ b/mod_pubsub_feeds/mod_pubsub_feeds.lua	Sun Jun 25 23:53:15 2023 +0200
@@ -151,10 +151,10 @@
 end
 
 function fetch(item, callback) -- HTTP Pull
-	local headers = { };
-	if item.etag then
-		headers["If-None-Match"] = item.etag;
-	end
+	local headers = {
+		["If-None-Match"] = item.etag;
+		["Accept"] = "application/atom+xml, application/x-rss+xml, application/xml";
+	};
 	http.request(item.url, { headers = headers }, function(data, code, resp)
 		if code == 200 then
 			if callback then callback(item, data) end