Mercurial Hosting > luan
diff src/luan/modules/http/tools/Dump_mod.luan @ 1150:0842b9b570f8
change http headers interface
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 04 Feb 2018 18:03:37 -0700 |
parents | 3bf5190b3c77 |
children | 4beabb087be6 |
line wrap: on
line diff
--- a/src/luan/modules/http/tools/Dump_mod.luan Sun Feb 04 17:23:20 2018 -0700 +++ b/src/luan/modules/http/tools/Dump_mod.luan Sun Feb 04 18:03:37 2018 -0700 @@ -4,17 +4,12 @@ local ipairs = Luan.ipairs or error() local Io = require "luan:Io.luan" local Http = require "luan:http/Http.luan" -java() -local Implementation = require "luan:http/Implementation.luan" -local HttpServicer = require(Implementation.java.."HttpServicer") + local Dump_mod = {} -local to_http_header_name = HttpServicer.toHttpHeaderName -Dump_mod.to_http_header_name = to_http_header_name - function Dump_mod.respond() - Http.response.header.content_type = "text/plain" + Http.response.headers["content-type"] = "text/plain" Io.stdout = Http.response.text_writer() local method = Http.request.method @@ -40,10 +35,9 @@ function Dump_mod.dump_headers(headers) for name, values in pairs(headers) do - local header_name = to_http_header_name(name) for _, value in ipairs(values) do %> -<%=header_name%>: <%=value%> +<%=name%>: <%=value%> <% end end