Mercurial Hosting > luan
changeset 1183:0f2890e2ba16
remove dump
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Wed, 21 Feb 2018 16:29:43 -0700 |
parents | 0b55a1af5a44 |
children | 2eba58842bbb |
files | scripts/test.luan src/luan/modules/http/tools/Dump_mod.luan src/luan/modules/http/tools/dump.luan |
diffstat | 3 files changed, 0 insertions(+), 46 deletions(-) [+] |
line wrap: on
line diff
diff -r 0b55a1af5a44 -r 0f2890e2ba16 scripts/test.luan --- a/scripts/test.luan Tue Feb 20 21:08:04 2018 -0700 +++ b/scripts/test.luan Wed Feb 21 16:29:43 2018 -0700 @@ -45,9 +45,6 @@ page = get_page "/shell" find(page,"abcd") or error "failed" -init() -page = get_page "/dump" - -- lucene
diff -r 0b55a1af5a44 -r 0f2890e2ba16 src/luan/modules/http/tools/Dump_mod.luan --- a/src/luan/modules/http/tools/Dump_mod.luan Tue Feb 20 21:08:04 2018 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -local Luan = require "luan:Luan.luan" -local error = Luan.error -local pairs = Luan.pairs or error() -local ipairs = Luan.ipairs or error() -local Io = require "luan:Io.luan" -local Http = require "luan:http/Http.luan" - - -local Dump_mod = {} - -function Dump_mod.respond() - Http.response.headers["content-type"] = "text/plain; charset=utf-8" - Io.stdout = Http.response.text_writer() - - local method = Http.request.method - local path = Http.request.full_path() -%> -<%=method%> <%=path%> <%=Http.request.protocol%> -<% - Dump_mod.dump_headers(Http.request.headers) -%> - -<% - if method == "POST" then -%> -<%=Io.repr(Http.request.parameters)%> -<% - end -end - - -function Dump_mod.dump_headers(headers) - for name, values in pairs(headers) do - for _, value in ipairs(values) do -%> -<%=name%>: <%=value%> -<% - end - end -end - -return Dump_mod