Software /
code /
prosody
Comparison
plugins/mod_http_errors.lua @ 11820:0375ef78ed64
mod_http_errors: Make it easier to override 'http-message' handler
Per the unspoken internal standard of -1 as priority for most built-in
event handlers, since this makes it easy for 3rd party plugins to
override behavior by hooking at the default priority of 0.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 24 Sep 2021 18:39:28 +0200 |
parent | 11664:d83f8f44caea |
child | 12977:74b9e05af71e |
comparison
equal
deleted
inserted
replaced
11819:f590e3c51eff | 11820:0375ef78ed64 |
---|---|
81 module:hook("http-message", function (event) | 81 module:hook("http-message", function (event) |
82 if event.response then | 82 if event.response then |
83 event.response.headers.content_type = "text/html; charset=utf-8"; | 83 event.response.headers.content_type = "text/html; charset=utf-8"; |
84 end | 84 end |
85 return render(html, event); | 85 return render(html, event); |
86 end); | 86 end, -1); |
87 | 87 |
88 local icon = [[ | 88 local icon = [[ |
89 <svg xmlns="http://www.w3.org/2000/svg" height="0.7em" viewBox="0 0 480 480" width="0.7em"> | 89 <svg xmlns="http://www.w3.org/2000/svg" height="0.7em" viewBox="0 0 480 480" width="0.7em"> |
90 <rect fill="#6197df" height="220" rx="60" ry="60" width="220" x="10" y="10"></rect> | 90 <rect fill="#6197df" height="220" rx="60" ry="60" width="220" x="10" y="10"></rect> |
91 <rect fill="#f29b00" height="220" rx="60" ry="60" width="220" x="10" y="240"></rect> | 91 <rect fill="#f29b00" height="220" rx="60" ry="60" width="220" x="10" y="240"></rect> |