Mercurial > prosody-modules
annotate mod_pubsub_forgejo/templates.lib.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 | 131b8bfbefb4 |
| children |
| rev | line source |
|---|---|
|
6175
131b8bfbefb4
mod_pubsub_forgejo: new module for forgejo webhooks
nicoco <nicoco@nicoco.fr>
parents:
diff
changeset
|
1 local module = { |
|
131b8bfbefb4
mod_pubsub_forgejo: new module for forgejo webhooks
nicoco <nicoco@nicoco.fr>
parents:
diff
changeset
|
2 push = { |
|
131b8bfbefb4
mod_pubsub_forgejo: new module for forgejo webhooks
nicoco <nicoco@nicoco.fr>
parents:
diff
changeset
|
3 title = "{data.sender.username} pushed {data.total_commits} commit(s) to {data.repository.name}", |
|
131b8bfbefb4
mod_pubsub_forgejo: new module for forgejo webhooks
nicoco <nicoco@nicoco.fr>
parents:
diff
changeset
|
4 content = "{data.commits#- {item.message|firstline} ({item.author.name})\n}", |
|
131b8bfbefb4
mod_pubsub_forgejo: new module for forgejo webhooks
nicoco <nicoco@nicoco.fr>
parents:
diff
changeset
|
5 id = "push-{data.head_commit.id}", |
|
131b8bfbefb4
mod_pubsub_forgejo: new module for forgejo webhooks
nicoco <nicoco@nicoco.fr>
parents:
diff
changeset
|
6 link = "{data.repository.html_url}/compare/{data.before|shorten}..{data.after|shorten}" |
|
131b8bfbefb4
mod_pubsub_forgejo: new module for forgejo webhooks
nicoco <nicoco@nicoco.fr>
parents:
diff
changeset
|
7 }, |
|
131b8bfbefb4
mod_pubsub_forgejo: new module for forgejo webhooks
nicoco <nicoco@nicoco.fr>
parents:
diff
changeset
|
8 pull_request = { |
|
131b8bfbefb4
mod_pubsub_forgejo: new module for forgejo webhooks
nicoco <nicoco@nicoco.fr>
parents:
diff
changeset
|
9 title = "{data.sender.username} {data.action} a pull request for {data.repository.name}", |
|
131b8bfbefb4
mod_pubsub_forgejo: new module for forgejo webhooks
nicoco <nicoco@nicoco.fr>
parents:
diff
changeset
|
10 content = "{data.pull_request.title}", |
|
131b8bfbefb4
mod_pubsub_forgejo: new module for forgejo webhooks
nicoco <nicoco@nicoco.fr>
parents:
diff
changeset
|
11 id = "pull-{data.pull_request.number}-{data.pull_request.updated_at}", |
|
131b8bfbefb4
mod_pubsub_forgejo: new module for forgejo webhooks
nicoco <nicoco@nicoco.fr>
parents:
diff
changeset
|
12 link = "{data.pull_request.html_url}" |
|
131b8bfbefb4
mod_pubsub_forgejo: new module for forgejo webhooks
nicoco <nicoco@nicoco.fr>
parents:
diff
changeset
|
13 }, |
|
131b8bfbefb4
mod_pubsub_forgejo: new module for forgejo webhooks
nicoco <nicoco@nicoco.fr>
parents:
diff
changeset
|
14 release = { |
|
131b8bfbefb4
mod_pubsub_forgejo: new module for forgejo webhooks
nicoco <nicoco@nicoco.fr>
parents:
diff
changeset
|
15 title = "{data.sender.username} {data.action} a release for {data.repository.name}", |
|
131b8bfbefb4
mod_pubsub_forgejo: new module for forgejo webhooks
nicoco <nicoco@nicoco.fr>
parents:
diff
changeset
|
16 content = "{data.release.name}", |
|
131b8bfbefb4
mod_pubsub_forgejo: new module for forgejo webhooks
nicoco <nicoco@nicoco.fr>
parents:
diff
changeset
|
17 id = "release-{data.release.tag_name}", |
|
131b8bfbefb4
mod_pubsub_forgejo: new module for forgejo webhooks
nicoco <nicoco@nicoco.fr>
parents:
diff
changeset
|
18 link = "{data.release.html_url}" |
|
131b8bfbefb4
mod_pubsub_forgejo: new module for forgejo webhooks
nicoco <nicoco@nicoco.fr>
parents:
diff
changeset
|
19 } |
|
131b8bfbefb4
mod_pubsub_forgejo: new module for forgejo webhooks
nicoco <nicoco@nicoco.fr>
parents:
diff
changeset
|
20 } |
|
131b8bfbefb4
mod_pubsub_forgejo: new module for forgejo webhooks
nicoco <nicoco@nicoco.fr>
parents:
diff
changeset
|
21 |
|
131b8bfbefb4
mod_pubsub_forgejo: new module for forgejo webhooks
nicoco <nicoco@nicoco.fr>
parents:
diff
changeset
|
22 return module |
