Software /
code /
prosody-modules
Comparison
mod_pubsub_feed/mod_pubsub_feed.lua @ 400:f42fe4229f8a
mod_pubsub_feed: Fix timestamp on Windows, which has no %T
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 24 Aug 2011 11:29:02 +0200 |
parent | 325:4e50e591a7fc |
child | 401:c85397063eca |
comparison
equal
deleted
inserted
replaced
399:4e0d36941ba1 | 400:f42fe4229f8a |
---|---|
135 end | 135 end |
136 | 136 |
137 function fetch(item, callback) -- HTTP Pull | 137 function fetch(item, callback) -- HTTP Pull |
138 local headers = { }; | 138 local headers = { }; |
139 if item.data and item.last_update then | 139 if item.data and item.last_update then |
140 headers["If-Modified-Since"] = date("!%a, %d %b %Y %T %Z", item.last_update); | 140 headers["If-Modified-Since"] = date("!%a, %d %b %Y %H:%M:%S %Z", item.last_update); |
141 --COMPAT We could have saved 6 bytes here, but Microsoft apparently hates %T, so you got this gigantic comment instead. | |
141 end | 142 end |
142 http.request(item.url, { headers = headers }, function(data, code, req) | 143 http.request(item.url, { headers = headers }, function(data, code, req) |
143 if code == 200 then | 144 if code == 200 then |
144 item.data = data; | 145 item.data = data; |
145 if callback then callback(item) end | 146 if callback then callback(item) end |