]> git.nbdom.net Git - nb.git/commitdiff
lib/lua/nb.lua
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 10 May 2018 03:04:48 +0000 (04:04 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 10 May 2018 03:04:48 +0000 (04:04 +0100)
lib/lua/nb.lua

index dc515c6ddc0c013882bdd01946e1e7ccdf9bc45f..a046e23d0229c5479678ea46a02f30089b3e06ef 100644 (file)
@@ -24,7 +24,6 @@ end
 function nb:ngx_location_md(fheader,ffooter)
 -- See https://github.com/bungle/lua-resty-template
 -- location ~ \.(md|html)$ {
---   default_type text/html;
 --   content_by_lua 'package.path = ngx.var.NB_ROOT .. "/lib/lua/?.lua;" .. package.path local nb = require("nb") nb:ngx_location_md()';
 -- }
        if not fheader then fheader = ngx.var.document_root .. "/header.html" end
@@ -92,6 +91,7 @@ function nb:ngx_location_md(fheader,ffooter)
                local header = self:readall(fheader)
                local footer = nb:readall(ffooter)
                content = header .. content .. footer
+               ngx.header["Content-type"] = "text/html"
        end
 
        template.render(content,vars)