Mercurial > prosody-modules
comparison mod_http_oauth2/mod_http_oauth2.lua @ 5544:cb141088eff0
mod_http_oauth2: Remove underscore prefix
LuaCheck considers this to mean that a variable it unused, but this one
is not.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 10 Jun 2023 12:04:00 +0200 |
parents | 46e512f4ba14 |
children | d4a2997deae9 |
comparison
equal
deleted
inserted
replaced
5543:fed5995180c5 | 5544:cb141088eff0 |
---|---|
70 js = read_file(template_path, "script.js"); | 70 js = read_file(template_path, "script.js"); |
71 }; | 71 }; |
72 | 72 |
73 local site_name = module:get_option_string("site_name", module.host); | 73 local site_name = module:get_option_string("site_name", module.host); |
74 | 74 |
75 local _render_html = require"util.interpolation".new("%b{}", st.xml_escape); | 75 local render_html = require"util.interpolation".new("%b{}", st.xml_escape); |
76 local function render_page(template, data, sensitive) | 76 local function render_page(template, data, sensitive) |
77 data = data or {}; | 77 data = data or {}; |
78 data.site_name = site_name; | 78 data.site_name = site_name; |
79 local resp = { | 79 local resp = { |
80 status_code = data.error and data.error.code or 200; | 80 status_code = data.error and data.error.code or 200; |
84 ["Referrer-Policy"] = "no-referrer"; | 84 ["Referrer-Policy"] = "no-referrer"; |
85 ["X-Frame-Options"] = "DENY"; | 85 ["X-Frame-Options"] = "DENY"; |
86 ["Cache-Control"] = (sensitive and "no-store" or "no-cache")..", private"; | 86 ["Cache-Control"] = (sensitive and "no-store" or "no-cache")..", private"; |
87 ["Pragma"] = "no-cache"; | 87 ["Pragma"] = "no-cache"; |
88 }; | 88 }; |
89 body = _render_html(template, data); | 89 body = render_html(template, data); |
90 }; | 90 }; |
91 return resp; | 91 return resp; |
92 end | 92 end |
93 | 93 |
94 local authorization_server_metadata = nil; | 94 local authorization_server_metadata = nil; |
1138 -- Optional static content for templates | 1138 -- Optional static content for templates |
1139 ["GET /style.css"] = templates.css and { | 1139 ["GET /style.css"] = templates.css and { |
1140 headers = { | 1140 headers = { |
1141 ["Content-Type"] = "text/css"; | 1141 ["Content-Type"] = "text/css"; |
1142 }; | 1142 }; |
1143 body = _render_html(templates.css, module:get_option("oauth2_template_style")); | 1143 body = render_html(templates.css, module:get_option("oauth2_template_style")); |
1144 } or nil; | 1144 } or nil; |
1145 ["GET /script.js"] = templates.js and { | 1145 ["GET /script.js"] = templates.js and { |
1146 headers = { | 1146 headers = { |
1147 ["Content-Type"] = "text/javascript"; | 1147 ["Content-Type"] = "text/javascript"; |
1148 }; | 1148 }; |