You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by se...@apache.org on 2018/10/09 17:45:12 UTC

[incubator-ponymail] branch master updated: Enh: Ensure non-printable chars are not lost ...

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail.git


The following commit(s) were added to refs/heads/master by this push:
     new 66862d3  Enh: Ensure non-printable chars are not lost ...
66862d3 is described below

commit 66862d30316df872bb29dcf544c0e38aa008b0f0
Author: Sebb <se...@apache.org>
AuthorDate: Tue Oct 9 18:45:10 2018 +0100

    Enh: Ensure non-printable chars are not lost ...
    
    ... in source and mbox output (#476)
---
 CHANGELOG.md        | 1 +
 site/api/mbox.lua   | 2 +-
 site/api/source.lua | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9d0140b..5ad7760 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,5 @@
 ## Changes in 0.11-SNAPSHOT
+- Enh: Ensure non-printable chars are not lost in source and mbox output (#476)
 - Enh: display buttons even if no mails are found in a month (#470)
 - Bug: Javascript URLs must always use URL_BASE (#469)
 - Bug: setup.py uses ES library version to decide what features the database supports (#464)
diff --git a/site/api/mbox.lua b/site/api/mbox.lua
index c485204..780f242 100644
--- a/site/api/mbox.lua
+++ b/site/api/mbox.lua
@@ -141,7 +141,7 @@ function handle(r)
                         checkFirst=true
                         -- TODO consider whether to optionally prefix '>From ', '^>>From ' etc. 
                         -- If so, just change the RE to "^>*From "
-                        r:puts(line) -- original line
+                        r:write(line) -- original line
                     end
                     r:puts("\n")
                 end
diff --git a/site/api/source.lua b/site/api/source.lua
index 5de4dec..9794694 100644
--- a/site/api/source.lua
+++ b/site/api/source.lua
@@ -46,7 +46,7 @@ function handle(r)
         if aaa.canAccessDoc(r, doc, account) then
             local doc_raw = elastic.get('mbox_source', doc.request_id)
             if doc_raw then
-                r:puts(doc_raw.source)
+                r:write(doc_raw.source)
             else
                 r:puts("Could not find the email source, sorry!")
             end