diff options
author | Özgür Kesim <oec@codeblau.de> | 2019-06-14 12:25:10 +0200 |
---|---|---|
committer | Özgür Kesim <oec@codeblau.de> | 2019-06-14 12:25:10 +0200 |
commit | 3459e20be1ccf864288ba8d5be7ee96bb29da42f (patch) | |
tree | abbd574373a4786cc541bff23c468910fec6081f | |
parent | 5d3cf69c90aef8f01e9ab11e63982d6849651420 (diff) |
base64 encoding and image/png fixed in Header
-rw-r--r-- | index.html | 2 | ||||
-rw-r--r-- | main.go | 1 | ||||
-rw-r--r-- | tools.json | 2 |
3 files changed, 3 insertions, 2 deletions
@@ -161,7 +161,7 @@ function run() { req.onreadystatechange = function() { switch (req.status) { case 200: - if (req.getResponseHeader("Content-Type") === "img/png") { + if (req.getResponseHeader("Content-Type") === "image/png") { output.innerHTML = '<img src="data:image/png;base64,' + req.responseText + '"/>'; } else { output.innerHTML = req.responseText; @@ -76,6 +76,7 @@ func (t *Tool) execute(in io.Reader, w http.ResponseWriter) { if e := cmd.Run(); e == nil { if t.ContentType != "" { w.Header().Add("Content-Type", t.ContentType) + w.Header().Set("Content-Transfer-Encoding", "base64") io.Copy(base64.NewEncoder(base64.StdEncoding, w), buf) } else { w.Header().Add("Content-Type", "image/svg+xml") @@ -32,7 +32,7 @@ "Args": ["+O-", "-D", "+A0.9", "+R3"], "Suffix": ".pov", "NeedsFile": true, - "ContentType": "img/png", + "ContentType": "image/png", "Description": "Povray, raytracer", "BgColor": "Orange", "Documentation": { |