diff options
-rw-r--r-- | app/template-stream.lsp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/app/template-stream.lsp b/app/template-stream.lsp index 17693af..9ed4ab7 100644 --- a/app/template-stream.lsp +++ b/app/template-stream.lsp @@ -1,4 +1,19 @@ -<% local viewtable, viewlibrary, pageinfo, session = ... %> +<% local view, viewlibrary, page_info, session = ... %> +<% +local viewtable = view +if view.type == "group" then + viewtable = nil + for name,value in pairs(view.value) do + if value.type == "raw" then + viewtable = value + break + end + end + if not viewtable then + return + end +end +%> Status: 200 OK Content-Type: <% print(viewtable.option or "application/octet-stream") %> <% if viewtable.length then %> @@ -9,4 +24,4 @@ Content-Length: <%= viewtable.length %> Content-Disposition: attachment; filename="<%= viewtable.label %>" <% end %> <% io.write("\n") %> -<% pageinfo.viewfunc(viewtable, viewlibrary, pageinfo, session) %> +<% page_info.viewfunc(viewtable, viewlibrary, page_info, session) %> |