mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
chore: Update SSL check in errors.lua and headers.lua
This commit updates the SSL check in the `errors.lua` and `headers.lua` files to use the `scheme` property of the `bw` context object instead of the `https_configured` property. This change ensures that the SSL check is consistent across the application and follows best practices for secure communication over HTTPS.
This commit is contained in:
parent
9279527acb
commit
8595eb4150
2 changed files with 2 additions and 2 deletions
|
|
@ -104,7 +104,7 @@ function errors:render_template(code)
|
|||
-- Override HSTS header
|
||||
local ssl
|
||||
|
||||
if self.ctx.bw and self.ctx.bw.https_configured == "yes" then
|
||||
if self.ctx.bw and self.ctx.bw.scheme == "https" then
|
||||
ssl = true
|
||||
else
|
||||
ssl = ngx.var.scheme == "https"
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ end
|
|||
function headers:header()
|
||||
-- Override upstream headers if needed
|
||||
local ngx_header = ngx.header
|
||||
local ssl = self.ctx.bw.https_configured == "yes"
|
||||
local ssl = self.ctx.bw.scheme == "https"
|
||||
for variable, header in pairs(self.all_headers) do
|
||||
if
|
||||
ngx_header[header] == nil
|
||||
|
|
|
|||
Loading…
Reference in a new issue