Mercurial > prosody-modules
comparison mod_pubsub_feeds/mod_pubsub_feeds.lua @ 3279:e6b25054c110
mod_pubsub_feeds: Log a message for HTTP 301 redirects
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sat, 25 Aug 2018 14:14:27 +0200 |
| parents | 958f0b8b502c |
| children | 645c4f14e03d |
comparison
equal
deleted
inserted
replaced
| 3278:958f0b8b502c | 3279:e6b25054c110 |
|---|---|
| 158 if resp.headers then | 158 if resp.headers then |
| 159 item.etag = resp.headers.etag | 159 item.etag = resp.headers.etag |
| 160 end | 160 end |
| 161 elseif code == 304 then | 161 elseif code == 304 then |
| 162 item.last_update = time(); | 162 item.last_update = time(); |
| 163 elseif code == 301 and resp.headers.location then | |
| 164 module:log("info", "Feed %q has moved to %q", item.url, resp.headers.location); | |
| 163 elseif code == < 100 then | 165 elseif code == < 100 then |
| 164 module:log("error", "Error fetching %q: %q[%d]", item.url, data, code); | 166 module:log("error", "Error fetching %q: %q[%d]", item.url, data, code); |
| 165 else | 167 else |
| 166 module:log("debug", "Unhandled status code %d when fetching %q", code, item.url); | 168 module:log("debug", "Unhandled status code %d when fetching %q", code, item.url); |
| 167 end | 169 end |
