diff --git a/calexium_lib/web/CXM_making_a_web_site.anubis b/calexium_lib/web/CXM_making_a_web_site.anubis index 68bb01e..c4baed4 100644 --- a/calexium_lib/web/CXM_making_a_web_site.anubis +++ b/calexium_lib/web/CXM_making_a_web_site.anubis @@ -1504,7 +1504,8 @@ public type HTTP_Answer: String /*content*/), custom_binary(HTTP_Status /*http_status*/, String /*mime_type*/, - ByteArray /*content*/), + ByteArray /*content*/, + List(HTTP_header)/*other headers*/), custom_tree (HTTP_Status /*http_status*/, String /*mime_type*/, Printable_tree /*content*/), @@ -4352,10 +4353,11 @@ define Printable_tree crlf, content . (Printable_tree)[] ], - custom_binary(HTTP_Status status, String mime_type, ByteArray content) then + custom_binary(HTTP_Status status, String mime_type, ByteArray content, List(HTTP_header) other_headers) then [ "HTTP/1.1 " + format(status), crlf, format_headers(standard_headers), format_headers(standard_headers_for(mime_type, length(content), failure)), + format_headers(other_headers), format_headers(additional_headers), crlf, content . (Printable_tree)[] diff --git a/calexium_lib/web/CXM_multihost_http_server.anubis b/calexium_lib/web/CXM_multihost_http_server.anubis index 6112428..3472f42 100644 --- a/calexium_lib/web/CXM_multihost_http_server.anubis +++ b/calexium_lib/web/CXM_multihost_http_server.anubis @@ -2323,6 +2323,15 @@ public define List(HTTP_header) http_header("Content-length", to_decimal(answer_body_size)) ]. +public define List(HTTP_header) + file_attached_header + ( + String filename + ) = + [ + http_header("Content-Disposition", "attachment; filename=\"" + filename +"\"") + ]. + define One www_url_answer -- libgit2 0.21.4