comparison mod_unified_push/mod_unified_push.lua @ 6411:b00638d74f46

mod_unified_push: Allow additional CORS headers for unified push (fixes #1985) - Request header "TTL" is mandated by the HTTP Push specification RFC 8030: https://datatracker.ietf.org/doc/html/rfc8030#section-5 - Firefox sends "Content-Encoding" with a HTTP form submission, so it is required when using the Unified Push testing tool at https://unifiedpush.org/test_wp.html (with the full URL being delivered by the UP-Example Android app) Adding both headers makes the Unified Push testing tool work from the browser. Resolves: https://issues.prosody.im/1985
author Christian Weiske <cweiske@cweiske.de>
date Sat, 21 Feb 2026 19:13:08 +0100
parents 18ed655c755d
children 5da6fb562df9
comparison
equal deleted inserted replaced
6410:f45c84d98cde 6411:b00638d74f46
196 end); 196 end);
197 end 197 end
198 198
199 module:provides("http", { 199 module:provides("http", {
200 name = "push"; 200 name = "push";
201 cors = {
202 enabled = true;
203 headers = {
204 ["content-encoding"] = true;
205 ttl = true;
206 };
207 };
201 route = { 208 route = {
202 ["GET /*"] = function (event) 209 ["GET /*"] = function (event)
203 event.response.headers.content_type = "application/json"; 210 event.response.headers.content_type = "application/json";
204 return [[{"unifiedpush":{"version":1}}]]; 211 return [[{"unifiedpush":{"version":1}}]];
205 end; 212 end;